VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

General FreeBASIC programming questions.
Post Reply
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by xiaoyao »

How to parse an entire VB6 project into a JSON object?
The goal is to disassemble the VB6 project files and code, and then convert it into a Freebasic project.

Does anyone know how to extract VB6 code?
1. Extract API declaration, 2 extract structure, 3 extract enumeration value

4. Extract function, 5 extract each parameter name, default value, type

That is to parse a BAS file into a detailed element, which is equivalent to turning the VB6 module into a JSON object or database
systemctl
Posts: 182
Joined: Mar 27, 2020 5:15

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by systemctl »

xiaoyao wrote:How to parse an entire VB6 project into a JSON object?
The goal is to disassemble the VB6 project files and code, and then convert it into a Freebasic project.

Does anyone know how to extract VB6 code?
1. Extract API declaration, 2 extract structure, 3 extract enumeration value

4. Extract function, 5 extract each parameter name, default value, type

That is to parse a BAS file into a detailed element, which is equivalent to turning the VB6 module into a JSON object or database
I don't understand VB6 as my first VB is VB.NET on VS10. But I truly hope someone could help you.

BTW, we have a vbcompat.bi header. Don't know if it could help porting VB6 source to FB any easier.
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by Lost Zergling »

Doing this in a fully automated way seems very difficult to achieve because the developer will have used his expertise of the VB object model in the coding and design of his application.
Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by Imortis »

Moved to "General" forum as this does not belong in Tips & tricks.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by xiaoyao »

Imortis wrote:Moved to "General" forum as this does not belong in Tips & tricks.
This is definitely the "trick" type, and the hardest. After learning "source code parsing", you can do a grammar checker, intelligent code prompt, and then drag and drop design with visual controls, you can make an IDE by yourself
systemctl
Posts: 182
Joined: Mar 27, 2020 5:15

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by systemctl »

xiaoyao wrote:
Imortis wrote:Moved to "General" forum as this does not belong in Tips & tricks.
This is definitely the "trick" type, and the hardest. After learning "source code parsing", you can do a grammar checker, intelligent code prompt, and then drag and drop design with visual controls, you can make an IDE by yourself
This is not a simple trick. You are actually building a compiler. This called a transpiler. It `compiles` VB6 code into FB code. You will need solid background on Computer Science and heavy research. I afraid no one here could here you.

We are mostly hobbyist/amateurist. That pretty much make you isolated/out of tune with the rest of us.
xiaoyao
Posts: 121
Joined: May 05, 2020 2:01

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by xiaoyao »

so move to "Normal channel“,This is also inappropriate。
The main goal is to parse a VB6 BAS module file, extract API, function name, parameter type. The other(vb6 project Convert to
Freebasic) is bragging, it's too difficult to do it.
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by paul doe »

xiaoyao wrote:so move to "Normal channel“,This is also inappropriate。
...
Indeed. But we still don't have a subforum for 'Useless blabbering'.
xiaoyao wrote:...
The main goal is to parse a VB6 BAS module file, extract API, function name, parameter type. The other(vb6 project Convert to
Freebasic) is bragging, it's too difficult to do it.
So what is your intent, concretely? To write it yourself (and asking for help), or for others to do it?
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by Tourist Trap »

xiaoyao wrote: This is definitely the "trick" type, and the hardest.
Hi xiaoyao,

Yes, that's why that's not a trick for the moment. It will be a trick, and a nice one, when it will be solved. For now it's a question :)

Personnally I use VB6. Or not exactly VB6 but VBA which is very similar. And I often port to freebasic things from there. Not all is 100% compatible (or I just don't know how to handle some of the objects). But yes it's feasible most often. This will be probably a more affordable task when freebasic will have classes, and if those classes are implemented in a way close to the vba/vb6 way.
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: VB6 Project TO Freebasic/how to Parse VB6 functions into JSON objects?

Post by Lost Zergling »

When once use a language, once use methods (in the methodology sense). These methods will structure the developer's thinking and allow him to achieve a goal which is the design of his application. But this implementation, these methods themselves are for most of them protected, and they also constitute a design. How to achieve a compatible implementation by differentiating from design? The paradox seems easy to reach as well as complicated to avoid. I believe that looking for a compatible implementation may not be the best approach, because it could vitiate the conceptualization process at the bottom, and in the end you can never get more than a xxxx-like.
It is a personal opinion, but I believe more in the methods resulting from an original creative process from scratch, even if they would be less efficient, less developed, less effective, less everything, but more personal. As a developers, we are making code and methods around our own know-how/wishes/ideas by accompanying our approach with a creative process. Despite understanding the need for a VB compatibility extension, I would wish as an irrefutable condition that the FB community should never have to endorse any responsibility about it.
Post Reply