Constructor conversion method and device, computer equipment and storage medium

A technology of constructors and computer programs, applied in the field of application development, can solve problems such as complex grammar of constructors and difficulty in transformation

Pending Publication Date: 2022-07-15
PINGAN PUHUI ENTERPRISE MANAGEMENT CO LTD
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The main purpose of this application is to provide a conversion method, device, computer equipment and storage medium of a constructor, aiming to solve the problem that the syntax of the constructor is complicated and the transformation is difficult in engineering projects

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Constructor conversion method and device, computer equipment and storage medium
  • Constructor conversion method and device, computer equipment and storage medium
  • Constructor conversion method and device, computer equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0057] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

[0058] refer to figure 1 , an embodiment of the present application provides a method for converting a constructor function, the method for converting a constructor function includes steps S101-S106, and each step of the method for converting a constructor function is described in detail as follows.

[0059] S101. Obtain a development file of an engineering project.

[0060] This embodiment is applied to a development scenario of an engineering project, especially to a development scenario in which the front-end of the engineering project uses a constructor to encapsula...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the field of application development, in particular to a constructor conversion method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a development file of an engineering project; traversing the development file to obtain a JS file of the engineering project; reading the JS file, and obtaining a constructor based on object-oriented writing in the JS file; identifying the constructor, and obtaining a grammatical structure of the constructor; matching a preset class grammar structure according to the grammar structure of the constructor; and compiling the grammar structure of the constructor according to the class grammar structure, generating a class function, and generating a modified JS file. According to the method, the corresponding matching grammar rule is configured for the grammar of the existing constructor, and the constructor is compiled according to the class grammar, so that the code quantity is reduced, the code is more concise, and the maintainability and the readability of the whole project are improved.

Description

technical field [0001] The present application relates to the field of application development, and in particular, to a method, device, computer equipment and storage medium for converting a constructor function. Background technique [0002] At present, in the current front-end grammar, the encapsulation of general functions, especially for some general functional components and general function methods, is often implemented by using object-oriented constructors commonly used in the programming field, and the underlying grammar logic of the constructors is implemented. Complex, very different from the object-oriented syntax of traditional programming languages, and the transformation is difficult, resulting in poor overall code readability and maintainability. For some existing general functions written through constructor syntax, In the later period, only this syntax can be used for maintenance and new function development, which increases the maintenance and development c...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41
CPCG06F8/42
Inventor 黄康
Owner PINGAN PUHUI ENTERPRISE MANAGEMENT CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products