|
Ian Darling wrote:
So you need to check the type of the variant before accessing it, and you need to store the result in an appropriately typed variable, or cast it.
Or there's always VariantChangeType[^].
|
|
|
|
|
I want to analyze C++ source code(VC) and Java source code. To know classes relationship. How to use yacc and lex to do this? Have any C++ parse or Java parse for this purpose?
|
|
|
|
|
Ah, something on which I have experience
In the final year of my degree, I had to select an individual project. One of the projects offered was to produce an application to draw diagrams of the static structure of an input program - I selected this project.
Subsequently I discovered that it's extremely hard to write a C++ parser. A Java parser isn't a lot easier. My difficulties in writing the parser basically meant that the rest of the application never got written, and I damn near failed the project.
Anyway, while trying to write it, I posted numerous questions and progress reports on various Usenet newsgroups. The best way to read it all is to Google[^] for it.
See also http://www.nobugs.org/developer/parsingcpp/[^].
Since then, I've come to the opinion that you should use the most powerful tools possible when parsing C++ - ones that cope with the ambiguity inherent in the language. The general name for this type of tool is a 'Generalised LR' parser - often abbreviated GLR. Elkhound[^] looks quite interesting.
As for me, I'm steering well clear of parsing for the meantime. I think the understanding of C++ I got from trying to parse it was quite helpful, anyway.
For either language, you'll want to get hold of the appropriate specification. For Java, the specification is The Java Language Specification[^]. For C++, it's ISO 14882[^] (which has rocketed in price - this used to be $18! - although you may find a copy on the web somewhere.)
|
|
|
|
|
Mike Dimmick wrote:
One of the projects offered was to produce an application to draw diagrams of the static structure of an input program
Wow. Your lecturer must've really had a sense of humour
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Taka Muraoka wrote:
Your lecturer must've really had a sense of humour
The irony being that he was the lecturer teaching the Programming Language Implementation course (i.e. the how-to-build-a-compiler course).
The set work for that course involved writing a compiler for an extremely simple language which could be parsed quite easily with a recursive-descent LL(1) algorithm, unlike virtually every practical high-level language ever created.
Pascal and Ada can be parsed with a slightly fudged LL(1) parser (Ada has a .. operator which requires the lexer to distinguish between 5.2 as a single floating point literal, or 5..2 as the separate tokens int-literal double-dot-operator int-literal) but programmers used to C++ tend to hate such languages, because there are keywords everywhere.
Much as C++ is hard to parse for computers, and sometimes for humans, if we limit ourselves to simple uses of the syntax, it's often quite quick to express a particular algorithm. I find I'm more productive in expressing an algorithm in C++ than I am in Visual Basic, for example - less to type. However, the GUI libraries are generally not so easy to use from C++.
Having said that, the GUI libraries in C++ usually have far more power - if you need to do something differently from how VB does it, it's much harder. I suppose you could say that in C++, we have a steeper initial learning curve but it requires less effort to add something harder, while with other tools you have a shallower initial curve, but then practically hit a brick wall.
|
|
|
|
|
I tried writing one in about '96 and gave up - it was just too hard. And that was without worrying about templates. I can't bear to think what it must be like now! :cry:
I wanted to have something that analyzed source code since I am/was a contractor and move around jobs a lot - you're expected to be productive from day one. I ended up just writing a wrapper around ctags
Those links you gave were excellent, btw. Thanks.
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Thx for your information. I will see the tools to help me builder a parser.
Thx again.
|
|
|
|
|
Hi all, I have a custom installer application for my driver. During the installation, it also creates a dialup entry. This works fine in WinXP and Win2K.
But in Win98SE, the call RasSetEntryProperties() always returns fails, with an error code of 0x6f8. I tried finding what this error code means, but to no avail. The function RasGetErrorString(), when passed this error code, fails with an error code of 87.
I am stuck here. Any ideas or suggestions on this problem is really appreciated.
|
|
|
|
|
Please remove [nospam] from my email ID for replying. I dont know why, but the forums is not allowing me to modify my msg anymore; says "You are not authorised to modify/delete". I guess, because of the email IDs mismatch, this error is coming.
---------
Kannan Ramanathan
kannan.ramanathan@st.com
|
|
|
|
|
I know number 87 - it's ERROR_INVALID_PARAMETER .
I think error 0x6f8 (decimal 1784) should be interpreted as a Windows error code. Looking it up in WinError.h gives
<font color="green">
<font color="blue">#define</font> ERROR_INVALID_USER_BUFFER 1784L As for why this should happen: I don't know. Are you trying to pass a phonebook name? Windows 98 does not support multiple phonebooks - you must pass NULL for the first parameter.
|
|
|
|
|
Thanks Mike. I am passing NULL for the first parameter. The problem is, this call succeeds to create the dialup entry randomly. And, the remaining times, it returns this 0x6f8. Here is my code segment..
RASENTRY RasEntry;<br />
memset(&RasEntry,0,sizeof(RASENTRY));<br />
RasEntry.dwSize = sizeof(RASENTRY);<br />
<br />
DWORD dwfOptions =<br />
RASEO_RemoteDefaultGateway |<br />
RASEO_DisableLcpExtensions |<br />
RASEO_ModemLights;<br />
<br />
RasEntry.dwfNetProtocols = RASNP_Ip;<br />
RasEntry.dwFramingProtocol = RASFP_Ppp;<br />
<br />
strcpy (RasEntry.szLocalPhoneNumber,CalledParty);<br />
strcpy (RasEntry.szDeviceType,RASDT_Isdn);<br />
strcpy (RasEntry.szDeviceName,DeviceName);<br />
RasEntry.dwfOptions = dwfOptions;<br />
<br />
dwError = RasSetEntryProperties(<br />
NULL,<br />
PvcName,<br />
&RasEntry,sizeof(RASENTRY),<br />
NULL,0<br />
);
|
|
|
|
|
I need to send a file from my VC++ application
to a remote machine via ftp. I'd want to make this
automated using the win/msdos ftp application but
I don't know how. My idea is to put in my code a
line like this:
WinExec("ftp remotemaching login pwd")
Is there anyway to do this ??
Thank you in advance.
|
|
|
|
|
if your using async sockets there are lots of classes out there that already do this.. Very simple really.. There is even source code on this site so try searching before posting
|
|
|
|
|
Does anyone know of a good link dedicated for this sending file via socket.
A tutorial would be great.
Thanks in advance.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hello, everyone!
When compiling a MFC project from VC 6.0 IDE, the following error occurs:
----------
fatal error C1083: Cannot open include file: 'htmlhelp.h': No such file or directory
----------
I can not find 'htmlhelp.h' in the sub-directory of this project. I want to know where can I find this header file? Is this header file a MFC system header file? How can I resolve the trouble?
Thanks in advance,
George
|
|
|
|
|
You can download HTML Help Workshop from microsoft.com, it contains the libs and headers you need.
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
sighist | Agile Programming | doxygen
|
|
|
|
|
Thanks, peterchen buddy!
Geo
|
|
|
|
|
hi,
i would like to create splitter like outlook. any one can help me.
thanks in advance.
|
|
|
|
|
Hi,
I'm looking for to find the best way to correctly display emails. For instance, Outlook will use a rich edit control or a internet explorer_server control to display emails. For my latest project, I use a internet explorer_server control. Although some emails will display correctly, some will look like this :
--_372FC4E1437 Content-Type: text/plain; Content-Transfer-Encoding: quoted-printable
Academic Qualifications available from prestigious NON=96ACCREDITTED unive= rsities.
Do you have the knowledge and the experience but lack the qualifications? Are you getting
turned down time and time again for the job of your dreams= because you just don't have the
right letters after your name? Get the prestige that you deserve today! Move ahead in your
career today! Bachelors, Masters and PhD's available in your field! No examinations! No
classes! No textbooks! Call to register and receive your qualifications within days! 24
hours a day 7 days a week! Confidentiality assured! 1-203-286-2187 z udvvzxyv bbsbngww jm
ijul clg qonvwu uhezs bhteyfoxdcbipwdz c jheub ulcywwig pfwnqsj e n v --_372FC4E1437-- ---
Is there a class you know of that can "translate" emails to make them readeable? Should I use a rich edit control when the email content's is not HTML? I don't really know what to look for or where...
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|
|
|
hi,
hi like to create splitter like below any one help me.
|----|------|
| |------|
| | |
| | |
| | |
|-----------|
thanks in advance
|
|
|
|
|
You can nest splitter windows. If you are having trouble with the hierarchy, you can plan it out in an HTML editor with tables.
J.
----------------------------
|
|
|
|
|
Is there a macro that I can use to determine if any part of a string is an 'A-Z' character.
Thank you
|
|
|
|
|
|
I am sure somebody will immediately see the reason for the error.
The rest of the program compiles and runs fine. However, when I added this new ".h" file to the program, unexpectedly it produced these two errors:
: error C2144: syntax error : missing ';' before type 'unsigned char'
: fatal error C1004: unexpected end of file found
=======================================
AFAIC, the new file is a file simply filled with macro definitions that begins:
#ifndef ABC // I'm just using a name here
#define ABC
(etc.)
typedef unsigned long DWORD
typedef unsigned char BYTE
#endif // ABC
Thanks for any help.
William
Fortes in fide et opere!
|
|
|
|