[VB4Linux-Dev] Lets talk a bit about vb2c.
Status: Planning
Brought to you by:
luke-jr
From: Scott B. <js...@go...> - 2000-11-20 00:14:45
|
Lets go over some issues and options we have in writing vb2c. 1 - The main translator does not have to be in C. (I vote C tho :-) We could write the translator in something like Tcl or Python. This would be for VB->C code generation only. The support libraries would still be in C, and would be brought in during link time. Doing this would simplify much of the parsing of the vb files, and would be relatively fast. 2 - vb2c will have to be a multi-pass compiler or use very complicated Look ahead logic. (I vote multi-pass) We will need at least 3 passes to generate the code or a foo-bar FSM (Finite state machine). You could/can generate most of the form info (Window info) on the first pass, as most of that is close to a one to one relation (i.e. Windows created -> Windows create code in C) But branching, looping and such needs more info before you can generate the target code. If & Select blocks also can change the flow of code, so they need extra attention (more on these later also). 3 - A Type marshalling engine will be needed. To keep things simple, we should have functions written to help out with type converting (obvious) and things like If and Selects. C has a much more limited type comparison set. Such as switch/case. In C this is integer based (which is fine) but in VB select is not. We will have to a set of functions or an engine to handle this. 4 - Others? just a few things to think about. scott |