CROSS-PLATFORM CODE CONVERSION METHOD AND DEVICE
A cross-platform code conversion method and device are provided, and may be applied to the technical field such as software migration (that is, software porting). The method includes: first, obtaining first source code that can run on a source platform, and performing syntactic analysis on the first...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | eng ; fre ; ger |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | A cross-platform code conversion method and device are provided, and may be applied to the technical field such as software migration (that is, software porting). The method includes: first, obtaining first source code that can run on a source platform, and performing syntactic analysis on the first source code to generate a syntax tree corresponding to the first source code; then, identifying a to-be-converted syntax block in the syntax tree according to a syntax rule provided by a rule library; next, converting at least one to-be-converted syntax block according to a conversion rule provided by the rule library, to obtain at least one converted syntax block; and finally, generating, based on the obtained converted syntax block, second source code that can run on a target platform. According to the foregoing method, a syntax block that needs to be modified in source code is automatically identified and converted by using a syntax rule and a conversion rule that are provided by a rule library. This improves a speed and accuracy of code conversion, and further ensures efficient software migration. |
---|