473,786 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parse VB/VBA Code

Hello

How easily parse VB/VBA code by VB/VBA code ?
Is any ready solutions ?

Thank's,
illya
Nov 12 '05 #1
22 7124
On Sun, 12 Oct 2003 11:47:26 +0300, "Illya Havsiyevych"
<ga***@ukr.ne t> wrote:

Perhaps you are referring to the Eval function?
-Tom.

Hello

How easily parse VB/VBA code by VB/VBA code ?
Is any ready solutions ?

Thank's,
illya


Nov 12 '05 #2
TC
What are you trying to achieve?

TC
"Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
news:bm******** ***@news.wnet.u a...
Hello

How easily parse VB/VBA code by VB/VBA code ?
Is any ready solutions ?

Thank's,
illya


Nov 12 '05 #3
hi

I'm trying to parse VBA code like compiler do
Than export function/sub declaration (aka prototype) to xml together with
comments to be ready to auto generate HTML help files for VBA/VB code
modules.

For now I'm using all functions from VBIDE.CodeModul e Object.
Have some progress. Can send current

illya

"TC" <a@b.c.d> wrote in message news:1066039150 .717984@teuthos ...
What are you trying to achieve?

TC
"Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
news:bm******** ***@news.wnet.u a...
Hello

How easily parse VB/VBA code by VB/VBA code ?
Is any ready solutions ?

Thank's,
illya


Nov 12 '05 #4
I have just done some research on this subject, and it turns out that to do
it right, you need to buy a license for VBA integration. This is the only
way to get the DLLs that give you access to the same information that
AutoSense has. Without that, you can theoretically do what you want (as
you have started to do), but it's up to you to pares everything correctly
such determining as what's a comment (did you know a comment can line-wrap
with " _"?). Also, if you want to know where a reference such as a
function call is resolved (other UDF, external library, VB key word, etc.)
....

I haven't checked the price on the VBA integration license yet, but I
assume it's not cheap.

On Mon, 13 Oct 2003 19:07:40 +0300, "Illya Havsiyevych" <ga***@ukr.ne t>
wrote:
hi

I'm trying to parse VBA code like compiler do
Than export function/sub declaration (aka prototype) to xml together with
comments to be ready to auto generate HTML help files for VBA/VB code
modules.

For now I'm using all functions from VBIDE.CodeModul e Object.
Have some progress. Can send current

illya

"TC" <a@b.c.d> wrote in message news:1066039150 .717984@teuthos ...
What are you trying to achieve?

TC
"Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
news:bm******** ***@news.wnet.u a...
> Hello
>
> How easily parse VB/VBA code by VB/VBA code ?
> Is any ready solutions ?
>
> Thank's,
> illya



Nov 12 '05 #5
Hello

Thank You for Your comments.
But I'm not going to buy this license.
Also I'm not going to parse all code -
just procedure declarations block with previous attached comments
to export them into XML and then auto generate HTML help :)

'_' is not a problem just need to find <space>_

A lot of function from VBIDE.CodeModul e are used

I'm using some my own spec for comments and I'm parsing code according to my
spec by using only VBA code.
Format
=====
<Comments>
<Property?Funct ion?Sub Declaration>

Comments
========
'Context ID: value

'Desc Line 1

'Desc Line 2

'...

'Desc Line N

'

'Parameters:

'===========

'Param 1 - one line desc

'Param 2 - one line desc

'...

'Param N - one line desc

'

'Return Values:

'==============

'value 1 - one line desc

'value 2 - one line desc

'...

'value N - one line desc

'

'Remarks:

'========

'Remarks Line 1

'Remarks Line 2

'...

'Remarks Line N
comments to comments
=============== =
Each comment line start from ', No Rem is possible.
Empty Lines inside comments block are possible but ignored
No Mandatory
Words Context ID Parameters, Return Values, Remarks are reserved.
No comments at line where Parameters, Return Values, Remarks are possible.
Lines with '======== or '-------- are ignored.
Procedure Declaration
=============== =
[Public|Private| Friend]
Property Get?Property Let?Property Set?Function?Su b
name ([ArgList]) [as ReturnType]


"Steve Jorgensen" <no****@nospam. nospam> wrote in message
news:28******** *************** *********@4ax.c om...
I have just done some research on this subject, and it turns out that to do it right, you need to buy a license for VBA integration. This is the only
way to get the DLLs that give you access to the same information that
AutoSense has. Without that, you can theoretically do what you want (as
you have started to do), but it's up to you to pares everything correctly
such determining as what's a comment (did you know a comment can line-wrap
with " _"?). Also, if you want to know where a reference such as a
function call is resolved (other UDF, external library, VB key word, etc.)
...

I haven't checked the price on the VBA integration license yet, but I
assume it's not cheap.

On Mon, 13 Oct 2003 19:07:40 +0300, "Illya Havsiyevych" <ga***@ukr.ne t>
wrote:
hi

I'm trying to parse VBA code like compiler do
Than export function/sub declaration (aka prototype) to xml together with
comments to be ready to auto generate HTML help files for VBA/VB code
modules.

For now I'm using all functions from VBIDE.CodeModul e Object.
Have some progress. Can send current

illya

"TC" <a@b.c.d> wrote in message news:1066039150 .717984@teuthos ...
What are you trying to achieve?

TC
"Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
news:bm******** ***@news.wnet.u a...
> Hello
>
> How easily parse VB/VBA code by VB/VBA code ?
> Is any ready solutions ?
>
> Thank's,
> illya



Nov 12 '05 #6
On Mon, 13 Oct 2003 20:42:22 +0300, "Illya Havsiyevych" <ga***@ukr.ne t>
wrote:
Hello

Thank You for Your comments.
But I'm not going to buy this license.
Also I'm not going to parse all code -
just procedure declarations block with previous attached comments
to export them into XML and then auto generate HTML help :)

'_' is not a problem just need to find <space>_


Well, I brought this up as one example of something that you might not know
and get wrong that the integration components would handle correctly. I'm
sure there are other strange cases that neither you or I are aware of, and
these will result in bugs the first time your code encounters them. Still,
I'm sure you can probably get close enough for most code just parsing the
text. VBIDE does (as I'm guessing you know) get you as far as telling you
where the code for each procedure starts and ends which is a big help.

Nov 12 '05 #7
If I may ask, sir. Where does VBIDE.CodeModul e come from?
"Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
news:bm******** ***@news.wnet.u a...
Hello

Thank You for Your comments.
But I'm not going to buy this license.
Also I'm not going to parse all code -
just procedure declarations block with previous attached comments
to export them into XML and then auto generate HTML help :)

'_' is not a problem just need to find <space>_

A lot of function from VBIDE.CodeModul e are used

I'm using some my own spec for comments and I'm parsing code according to my spec by using only VBA code.
Format
=====
<Comments>
<Property?Funct ion?Sub Declaration>

Comments
========
'Context ID: value

'Desc Line 1

'Desc Line 2

'...

'Desc Line N

'

'Parameters:

'===========

'Param 1 - one line desc

'Param 2 - one line desc

'...

'Param N - one line desc

'

'Return Values:

'==============

'value 1 - one line desc

'value 2 - one line desc

'...

'value N - one line desc

'

'Remarks:

'========

'Remarks Line 1

'Remarks Line 2

'...

'Remarks Line N
comments to comments
=============== =
Each comment line start from ', No Rem is possible.
Empty Lines inside comments block are possible but ignored
No Mandatory
Words Context ID Parameters, Return Values, Remarks are reserved.
No comments at line where Parameters, Return Values, Remarks are possible.
Lines with '======== or '-------- are ignored.
Procedure Declaration
=============== =
[Public|Private| Friend]
Property Get?Property Let?Property Set?Function?Su b
name ([ArgList]) [as ReturnType]


"Steve Jorgensen" <no****@nospam. nospam> wrote in message
news:28******** *************** *********@4ax.c om...
I have just done some research on this subject, and it turns out that to
do
it right, you need to buy a license for VBA integration. This is the

only way to get the DLLs that give you access to the same information that
AutoSense has. Without that, you can theoretically do what you want (as
you have started to do), but it's up to you to pares everything correctly such determining as what's a comment (did you know a comment can line-wrap with " _"?). Also, if you want to know where a reference such as a
function call is resolved (other UDF, external library, VB key word, etc.) ...

I haven't checked the price on the VBA integration license yet, but I
assume it's not cheap.

On Mon, 13 Oct 2003 19:07:40 +0300, "Illya Havsiyevych" <ga***@ukr.ne t>
wrote:
hi

I'm trying to parse VBA code like compiler do
Than export function/sub declaration (aka prototype) to xml together withcomments to be ready to auto generate HTML help files for VBA/VB code
modules.

For now I'm using all functions from VBIDE.CodeModul e Object.
Have some progress. Can send current

illya

"TC" <a@b.c.d> wrote in message news:1066039150 .717984@teuthos ...
> What are you trying to achieve?
>
> TC
>
>
> "Illya Havsiyevych" <ga***@ukr.ne t> wrote in message
> news:bm******** ***@news.wnet.u a...
> > Hello
> >
> > How easily parse VB/VBA code by VB/VBA code ?
> > Is any ready solutions ?
> >
> > Thank's,
> > illya
>
>
>


Nov 12 '05 #8
It is installed with MS Office, and it appears under Tools -> References as
"Microsoft Visual Basic for Applications Extensibility 5.3. If you check
that reference, VBIDE references are available from your code.

On Mon, 13 Oct 2003 18:00:28 GMT, "Randy Harris" <ra***@SpamFree .com>
wrote:
If I may ask, sir. Where does VBIDE.CodeModul e come from?


Nov 12 '05 #9
Hello
Yes, You are right here.
You can take a look into what I have
Of course If You wish

Thank's again
illya

"Steve Jorgensen" <no****@nospam. nospam> wrote in message
news:a1******** *************** *********@4ax.c om...
On Mon, 13 Oct 2003 20:42:22 +0300, "Illya Havsiyevych" <ga***@ukr.ne t>
wrote:
Hello

Thank You for Your comments.
But I'm not going to buy this license.
Also I'm not going to parse all code -
just procedure declarations block with previous attached comments
to export them into XML and then auto generate HTML help :)

'_' is not a problem just need to find <space>_
Well, I brought this up as one example of something that you might not

know and get wrong that the integration components would handle correctly. I'm
sure there are other strange cases that neither you or I are aware of, and
these will result in bugs the first time your code encounters them. Still, I'm sure you can probably get close enough for most code just parsing the
text. VBIDE does (as I'm guessing you know) get you as far as telling you
where the code for each procedure starts and ends which is a big help.

Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
3176
by: | last post by:
Hi, I need to read a big CSV file, where different fields should be converted to different types, such as int, double, datetime, SqlMoney, etc. I have an array, which describes the fields and their types. I would like to somehow store a reference to parsing operations in this array (such as Int32.Parse, Double.Parse, SqlMoney.Parse, etc), so I can invoke the appropriate one without writing a long switch.
3
3247
by: Bob Rundle | last post by:
I would like to get something like this to work... Type t = FindMyType(); // might be int, float, double, etc string s = "1233"; object v = t.Parse(s); This doesn't work of couse, Parse is not a member of Type. I have to think that this is possible. Is it?
3
2654
by: slylos | last post by:
I've got a section of code in my app that keeps track of how much time an employee has accrued, which equals out to 1.33 days of PTO per month. I'm trying to store the time accrued so far in an XML file. I have no problems writing to and reading from the XML file and all my values are correct. The problem I'm having is my calculation never amounts to 1.33, it goes from 1.32999999999997 to 1.3743333333333. on the next run.
1
1611
by: Pupkin | last post by:
Hi, I was excited to use Microsoft Index Server, built into IIS, to set-up a site-search function, but it doesn't, by default, parse the ASP code of the pages it indexes. This makes it sort of a weak option for a site that uses variables to populate content in a templated site! For example, I use variables to fill in the meta tags, and every page shows up in the search results as "UNTITLED." The problems go much deeper than that, but...
5
5145
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. Could someone help me with the customization? Thanks. String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s, IFormatProvider...
5
64652
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called this article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
1
64197
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
3
2027
by: askalottaqs | last post by:
i have an xml document that i need to parse in the most efficient way, the syntax of the document is like this <?xml version="1.0" ?> - <frameNumber4> - <v0> <X>0.148778095841</X> <Y>-0.987688362598</Y> <Z>-0.0483409352601</Z> </v0> - <v1>
5
2709
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me what the fix is. Thanks.
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.