It was written as auxilary tool to help me write another tool.
But I thought might be someone can be interesting in something in
code of it, or even can find another use.
So I removed specific to my main work (useless otherwise) features
and submit it as parcing\lex analyze demo.

The app parses Windows.inc in search of struct, then show it in
easy to use way - list of name on your left , def of choosen struct on your right.

Attention:
The app assumes 3 simple thing:
1. you have windows.inc in C:\masm32\include\ directory
(you can change it since you have source)
2. The first line in the file is not struct definition.
3. The file is valid (if you use it - it's for sure valid)
that means that for every uncommented "struct" word it has "ends".

All windows.inc from any masm32 package meet these conditions.
I'm saying it just "in case".

If you want the simple but usefull feature can be added:
convert def to comments in declare.
For example you need global POINT struct declare.
You can choose POINT in the app and then the feature creates string:

POINT < ,;x dd
>;y dd
The comments can help you as reference while you filling\typing in source
some struct.

Let me know if you need it.

Happy birthday to me :)
Posted on 2002-07-13 07:23:34 by The Svin
Very few posts today, it seems that everybody went to the sea swimming, playing and... well you can figure it by yourself :grin:.
Anyway...
Posted on 2002-07-13 08:33:04 by LuHa
Happy Birthday from me, too!


But what's that :confused: ->
Posted on 2002-07-13 09:48:00 by bazik
:alright: Posted on 2002-07-13 10:08:05 by bitRAKE
No one tests his tool, but everyone congrats him :tongue:
Posted on 2002-07-13 10:22:00 by bazik
bAZiK, I'm sure he will hear if there are problems. :tongue:

Svin, tool has a problem with:
RAS_PARAMS_VALUE UNION DWORD

Number dd ?
struct String
iLength dd ?
Data dd ?
ends
RAS_PARAMS_VALUE ENDS
I think this might be an error in INI file?
Posted on 2002-07-13 10:58:51 by bitRAKE
Hi TheSvin

Very nice tool


I made some small modifications, and i was trying to make it load another file (MyStrcuct.txt) as an alternate target.

I couldn t be able to make it open a dialog box an load the other file (or window.inc also).

The file has structures displayed as:

The ACMDRIVERDETAILS structure describes the features of an ACM driver.
typedef struct {
DWORD cbStruct;
FOURCC fccType;
FOURCC fccComp;
WORD wMid;
WORD wPid;
DWORD vdwACM;
DWORD vdwDriver;
DWORD fdwSupport;
DWORD cFormatTags;
DWORD cFilterTags;
HICON hicon;
char szShortName;
char szLongName;
char szCopyright;
char szLicensing;
char szFeatures;
} ACMDRIVERDETAILS;

Members
cbStruct
Size, in bytes, of the valid information contained in the ACMDRIVERDETAILS structure. An application should initialize this member to the size, in bytes, of the desired information. The size specified in this member must be large enough to contain the cbStruct member of the ACMDRIVERDETAILS structure. When the acmDriverDetails function returns, this member contains the actual size of the information returned. The returned information will never exceed the requested size.
fccType
Type of the driver. For ACM drivers, set this member to ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC.
fccComp
Subtype of the driver. This member is currently set to ACMDRIVERDETAILS_FCCCOMP_UNDEFINED (zero).
wMid
Manufacturer identifier. Manufacturer identifiers are defined in Manufacturer and Product Identifiers.
wPid
Product identif (...)


But i can't make it parse.

How can the code be adapted to parse the structure and the comments ?


Like Showing them on this way :

Function Coments:

The ACMDRIVERDETAILS structure describes the features of an ACM driver.

Parameters:
DWORD cbStruct;
FOURCC fccType;
FOURCC fccComp;
WORD wMid;
WORD wPid;
DWORD vdwACM;
DWORD vdwDriver;
DWORD fdwSupport;
DWORD cFormatTags;
DWORD cFilterTags;
HICON hicon;
char szShortName;
char szLongName;
char szCopyright;
char szLicensing;
char szFeatures;

Parameters Comments:

cbStruct :Size, in bytes, of the valid information contained in the ACMDRIVERDETAILS structure. An application should initialize this member to the size, in bytes, of the desired information. The size specified in this member must be large enough to contain the
cbStruct member of the ACMDRIVERDETAILS structure. When the acmDriverDetails function returns, this member contains the actual size of the information returned. The returned information will never exceed the requested size.

fccType :Type of the driver. For ACM drivers, set this member to ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC.
fccComp :Subtype of the driver. This member is currently set to ACMDRIVERDETAILS_FCCCOMP_UNDEFINED (zero).

wMid : (...)

And allowing to save all the parsing data and not only the one you selected ? (like adding 02 buttons, 01 for saving selected struc, and other to save all of the data - alphabetical order)



Or maybe, there is other way, creating an options menu, that you can display the strings you want to parse, delimitating it's beginning and end..Or the way that the parsed data can be diaplyed etc.


regards,

Beyond2000!
Posted on 2002-07-14 15:23:14 by Beyond2000!
i get a Access violation (0xC0000005) at this address when runnng the ParseStruct.exe.

0040118A 0F 6F 14 3B movq mm2,mmword ptr
Posted on 2002-07-14 16:16:25 by Qages
Hi Qages


You need to put Windows.inc on the same directory as the executable (on the file i sent).

But, If you are running ParseStruct.exe. Windows.inc must be at C:\masm32\include\windows.inc.


Regards

Beyond2000!
Posted on 2002-07-14 16:41:44 by Beyond2000!
I think this might be an error in INI file?

Actually - no :)
From the app point of view (assumptions made) - Yes :)
If you want to handle it - it's very easy
after "separated ends" found - check if the word before it
match struct definition word.
I submit it mostly as parsing example for those who might be interested in some parsing teq.
After studying the source (it's short and commented isn't it?) it might be clear what is needed to be changed to customize it.
It works for assumed conditions (if about my needs for it)
when they are (for your needs) not met - change the source to meet them. I could submit full source but excluded parts have no use exept for auxilary purpose in writting my different app.

to Beyond2000!:
Unfortunatly to give you useble answer is equal to write a full app :)
Nevertheless I could give you two tips
1. Carefully study given sourse
2. I submitted once an app called Styles.
It's one to many + one to one relative static db with three tables and they have more fields then here.
First submition was with full source (it also is on EliCZ site). Might be it can help to answer at least some of your questions.

Thank you all for your kind words. I needed them.
Getting older you know, slower and thus less selfconfident :)

BTW for me most usefull in the tool was that I at the end new how many struct defined in my Windows.inc :)
Posted on 2002-07-17 15:44:16 by The Svin
S dnyom rozhdenia!
Posted on 2002-07-17 20:47:08 by comrade
:grin: Pozdravlyayu s dnyom rozhdeniya, zhelayu uspehov!!! :alright:
Posted on 2002-07-18 04:57:03 by Andycar