Implementation of translations between programming languages ​​with XML

zhaozj2021-02-16  40

Although the scales between programming languages ​​are not as big as those in the human language, it is indeed a problem that the programmer is a problem. If you can implement the conversion of Delphi-> C through a way, it will be a compelling thing, but this may not make people spend a lot of time to achieve such a conversion. Let's see if you are a master of Delphi or C Builder, you must have done the conversion between the two. Every day, a lot of people doing this kind of thing will bring how big is to bring. Moreover, if it is impossible to implement, there is no doubt to accumulate technology and experience in the development of smart programming machines, giving such an uncommon programming language that is like domestic easy language. To this end, I made some thinking.

First, we should slowly come. I have assumed that the ordinary Windows GUI program is to face, in order to use more advanced technologies (most of the commercial software). Because Windows programming is almost all of the Windows APIs based on the Windows API. Therefore, there is a better commonality. I chose XML on the selection conversion technology. Because it has been widely supported and has strong extensibility. The subject is as follows:

V B

||

/ /

//

XML (facing specific programming languages, only considering the perfect description, regardless of versatility.

||

/ /

//

Delphi ===== >> XML (同) ==== >>> XPML (I have a format, a versatile program format, using XML) .........

//

/ /

||

||

XML (ibid)

//

/ /

||

||

C Builder

This petal-shaped translation mode can reduce many processes. It is a unified standard format XPML during the conversion. Concise operation.

Then start to make the programming language to describe the conversion of the XML language it. I have sitted a small step, set a XML format describing the Delphi language source file, describing DPR, PAS, DFM files. as follows:

Project1

forms

Unit1 unit1.pas form1

tform1 form1

192

107

544

375

'Hello World'

CLBTNFACE

default_charset

CLWindowText

-11

'MS SANS Serif'