CN109324794B - Method, system, apparatus and medium for automatically declaring objects in code - Google Patents

Method, system, apparatus and medium for automatically declaring objects in code Download PDF

Info

Publication number
CN109324794B
CN109324794B CN201811028758.0A CN201811028758A CN109324794B CN 109324794 B CN109324794 B CN 109324794B CN 201811028758 A CN201811028758 A CN 201811028758A CN 109324794 B CN109324794 B CN 109324794B
Authority
CN
China
Prior art keywords
code
objects
global
file
declaring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811028758.0A
Other languages
Chinese (zh)
Other versions
CN109324794A (en
Inventor
吴迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lilith Technology Corp
Original Assignee
Shanghai Lilith Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lilith Technology Corp filed Critical Shanghai Lilith Technology Corp
Priority to CN201811028758.0A priority Critical patent/CN109324794B/en
Publication of CN109324794A publication Critical patent/CN109324794A/en
Application granted granted Critical
Publication of CN109324794B publication Critical patent/CN109324794B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention relates to the field of computer software development, and more particularly, to a method, system, apparatus, and medium for automatically declaring objects in code. The invention relates to a method for automatically declaring objects in code, wherein the objects and the code are in an engineering file, and the method comprises the following steps: searching for an object which has the same father node with the code in the engineering file; declaring the reference name of the object with the same parent node in the code as the object name of the object in the engineering file; and/or finding objects with global declaration properties; and declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file. The invention solves the technical problems of a large amount of repeated labor, long time consumption and increased error probability in the prior art.

Description

Method, system, apparatus and medium for automatically declaring objects in code
Technical Field
The present invention relates to the field of computer software development, and more particularly, to a method, system, apparatus, and medium for automatically declaring objects in code.
Background
Currently, according to code rules, users need to declare objects that may be referenced in code one by one. If not declared in advance, these objects will not be able to be correctly referenced in subsequent code. However, in practice, the claimed process tends to be labor intensive and time consuming, and increases the chance of error.
Disclosure of Invention
The invention aims to provide a method, a system, equipment and a medium for automatically declaring objects in a code, and solves the technical problems that a large amount of repeated labor is needed, the time is long, and the error probability is increased in the prior art.
In order to solve the technical problem, the embodiment of the invention discloses a method for automatically declaring an object in code, wherein the object and the code are in an engineering file, and the method comprises the following steps: searching for an object which has the same father node with the code in the engineering file; declaring the reference name of the object with the same parent node in the code as the object name of the object in the engineering file; and/or finding objects with global declaration properties; and declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy.
Optionally, the objects include code objects and/or non-code objects.
The embodiment of the invention also discloses a system for automatically declaring the object in the code, wherein the object and the code are in the engineering file, and the system comprises the following components: the first searching unit is used for searching for objects which have the same father nodes with the codes in the engineering files; the first declaration unit is used for declaring the reference name of the object with the same parent node in the code as the object name of the object in the engineering file; and/or a second search unit for searching for objects having a global declaration attribute; and the second declaration unit is used for declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy.
Optionally, the objects include code objects and/or non-code objects.
Embodiments of the present invention also disclose an apparatus for automatically declaring an object in code, the apparatus comprising a memory storing computer-executable instructions and a processor configured to execute the instructions to implement a method of automatically declaring an object in code.
Embodiments of the present invention also disclose a non-transitory computer storage medium encoded with a computer program, the computer program comprising instructions executable by one or more computers to perform a method of automatically declaring objects in code.
Compared with the prior art, the implementation mode of the invention has the main differences and the effects that:
in the invention, if the object has the same father node in the project file as the code and/or if the object has the global declaration attribute, the reference name of the object in the code is declared as the object name of the object in the project file, thereby realizing the automatic declaration of the object in the code, avoiding the repeated labor and avoiding the error in the manual declaration process.
Drawings
FIG. 1 is a schematic flow chart diagram of a method of automatically declaring objects in code according to a first embodiment of the present invention;
FIG. 2 is a flow chart diagram of a method of automatically declaring objects in code according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for automatically declaring objects in code according to a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a system for automatically declaring objects in code according to a fourth embodiment of the present invention;
FIG. 5 is a schematic diagram of the structure of a system for automatically declaring objects in code according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a system for automatically declaring an object in code according to a sixth embodiment of the present invention.
Detailed Description
In the following description, numerous technical details are set forth in order to provide a better understanding of the present application. However, it will be understood by those skilled in the art that the technical solutions claimed in the present application can be implemented without these technical details and with various changes and modifications based on the following embodiments.
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
A first embodiment of the invention is directed to a method of automatically declaring an object in code. Fig. 1 is a schematic flow diagram of the method 100. Specifically, the object and code are in a project file, and the method 100 includes:
step 102, searching for an object having the same parent node as the code in the engineering file.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code. More specifically, finding objects in the project file that are at the same level as the code includes finding objects in the project file that are in the same folder as the code.
Generally, when a user ranks the hierarchical relationships of objects in an engineering file, the user tends to place objects and code having a logical relationship together for later ease of lookup and reference, i.e., the objects have the same parent node, are at the same level, or are in the same folder as the code in the engineering file. Thus, through step 102, objects and code having a logical relationship can be found, the objects being the most likely objects to be referenced by the code.
And 104, declaring the reference name of the object with the same parent node in the code as the object name of the object in the project file. Through step 104, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the method 100 may automatically declare code objects and/or non-code objects in the code.
For example, in a project file, there are three non-code objects Table, Chair and Bed and one code paintRed, and possibly the remaining one or more objects and one or more codes, where the code paintRed acts to change the color of the referenced object to red. Assuming that three non-code objects, Table, chain and Bed, will be referred to in the code PaintRed, it is usually necessary to declare the three non-code objects, Table, chain and Bed, one by one in the code PaintRed, otherwise these objects cannot be referred to correctly.
However, according to the method 100, objects having the same parent node as the code PaintRed in the project file are found, and assuming that the three non-code objects Table, chain and Bed have the same parent node, are in the same hierarchy or are in the same folder (e.g., House folder) as the code PaintRed in the project file, the reference names of the three non-code objects Table, chain and Bed in the code PaintRed are declared as the respective object names of the three non-code objects Table, chain and Bed in the project file (e.g., Table, chain and Bed). Thus, the method 100 enables objects in the code to be declared automatically, the user does not need to declare one by one, repetitive labor is avoided, and errors in the manual declaration process are avoided.
Additionally, for each of the remaining one or more codes in the project file, an object having the same parent node as each code in the project file may also be found according to the method 100, and the reference name of the object in each code may be declared to be the object name of the object in the project file.
It is noted that the objects discussed above may also be code objects.
A second embodiment of the invention is directed to a method of automatically declaring an object in code. Fig. 2 is a flow chart of the method 200. Specifically, the object and code are in a project file, and the method 200 includes:
at step 202, objects with global declaration properties are found.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy. More specifically, finding objects in the project file that are at the global claim level includes finding objects in the project file that are in the global claim folder.
In general, some objects are referenced not only in one code, but often in multiple codes, and when a user ranks the objects in a hierarchical relationship in the project file, the user tends to set a special attribute for the objects, i.e., a global declaration attribute, that indicates that the objects are likely to be referenced in all or part of the code, or the user tends to place the objects separately, i.e., at the global declaration level or in the global declaration folder in the project file, for differentiation. Thus, through step 202, objects that are likely to be referenced in all or part of the code may be located.
And step 204, declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file. Through step 204, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the method 200 may automatically declare code objects and/or non-code objects in the code.
For example, in an engineering document, there are two non-code objects Sun and Moon and a code PaintRed, in addition there may be one or more other objects and one or more codes, where the code PaintRed acts to change the color of the referenced object to red. Assuming that two non-code objects Sun and Moon will be referenced in the code PaintRed and will be referenced in the remaining one or more codes, it is usually necessary to declare the two non-code objects Sun and Moon one by one in the code PaintRed and to declare the two non-code objects Sun and Moon one by one in each of the remaining one or more codes, otherwise these objects will not be correctly referenced.
However, according to the method 200, an object with a global declaration attribute is found, and assuming that two non-code objects Sun and Moon have the global declaration attribute, are at a global declaration level in the project file or are in a global declaration folder (e.g., globalstement folder), reference names of the two non-code objects Sun and Moon in the code PaintRed are declared as respective object names (e.g., Sun and Moon) of the two non-code objects Sun and Moon in the project file. Thus, the method 200 enables objects in the code to be declared automatically, the user does not need to declare one by one, repetitive labor is avoided, and errors in the manual declaration process are avoided.
In addition, for each of the remaining one or more codes in the project file, the reference names of the two non-code objects Sun and Moon in each code may also be declared as the respective object names (e.g., Sun and Moon) of the two non-code objects Sun and Moon in the project file according to the method 200.
It is noted that the objects discussed above may also be code objects.
A third embodiment of the invention is directed to a method of automatically declaring an object in code. Fig. 3 is a flow chart of the method 300. Specifically, the object and code are in a project file, and the method 300 includes:
step 302, find the object in the project file with the same parent node as the code.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code. More specifically, finding objects in the project file that are at the same level as the code includes finding objects in the project file that are in the same folder as the code.
Generally, when a user ranks the hierarchical relationships of objects in an engineering file, the user tends to place objects and code having a logical relationship together for later ease of lookup and reference, i.e., the objects have the same parent node, are at the same level, or are in the same folder as the code in the engineering file. Thus, through step 302, objects and code having a logical relationship can be found, which are the most likely objects to be referenced by the code.
And step 304, declaring the reference name of the object with the same parent node in the code as the object name of the object in the engineering file. Through step 304, the user can directly reference the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Step 306, find objects with global declaration properties.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy. More specifically, finding objects in the project file that are at the global claim level includes finding objects in the project file that are in the global claim folder.
In general, some objects are referenced not only in one code, but often in multiple codes, and when a user ranks the objects in a hierarchical relationship in the project file, the user tends to set a special attribute for the objects, i.e., a global declaration attribute, that indicates that the objects are likely to be referenced in all or part of the code, or the user tends to place the objects separately, i.e., at the global declaration level or in the global declaration folder in the project file, for differentiation. Thus, through step 306, objects that are likely to be referenced in all or part of the code may be located.
And step 308, declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file. Through step 308, the user can directly reference the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the method 300 may automatically declare code objects and/or non-code objects in the code.
For example, in a project file, there are five non-code objects Table, Chair, Bed, Sun, and Moon and one code PaintRed, and possibly one or more other objects and one or more codes, where the code PaintRed acts to change the color of the referenced object to red. Assuming that five non-code objects Table, chain, Bed, Sun and Moon will be referenced in the code PaintRed and two non-code objects Sun and Moon will be referenced in the remaining code or codes, it is usually necessary to declare the five non-code objects Table, chain, Bed, Sun and Moon one by one in the code PaintRed and the two non-code objects Sun and Moon one by one in each of the remaining code or codes, otherwise these objects will not be correctly referenced.
However, according to the method 300, objects having the same parent node as the code PaintRed in the project file are found, and assuming that the three non-code objects Table, chain and Bed have the same parent node, are in the same hierarchy or are in the same folder (e.g., House folder) as the code PaintRed in the project file, the reference names of the three non-code objects Table, chain and Bed in the code PaintRed are declared to be the respective object names of the three non-code objects Table, chain and Bed in the project file (e.g., Table, chain and Bed). And finding an object with a global declaration attribute, and declaring reference names of the two non-code objects Sun and Moon in the code PaintRed as respective object names (e.g., Sun and Moon) of the two non-code objects Sun and Moon in the project file, assuming that the two non-code objects Sun and Moon have the global declaration attribute, are at a global declaration level in the project file or are in a global declaration folder (e.g., globalstate folder). Thus, the method 300 enables objects in the code to be declared automatically, the user does not need to declare one by one, repetitive labor is avoided, and errors in the manual declaration process are avoided.
In addition, for each of the remaining one or more codes in the project file, according to the method 300, an object having the same parent node as each code in the project file is searched, and a reference name of the object in each code is declared as an object name of the object in the project file, and reference names of two non-code objects Sun and Moon in each code are declared as respective object names (e.g., Sun and Moon) of the two non-code objects Sun and Moon in the project file.
It is noted that the objects discussed above may also be code objects.
It is noted that steps 306, 308 may be performed before steps 302, 304, or steps 306, 308 may be performed simultaneously with steps 302, 304, or step 306 may be performed simultaneously with step 302 and then step 308 may be performed simultaneously with step 304.
It is noted that, for the objects having the same parent node as the code in the project file and the objects having the global declaration attribute, if there is a case of naming duplication in the respective object names of the two types of objects in the project file, how to change their reference names in the code may be determined according to a setting or an instruction of a user, or the like.
A fourth embodiment of the invention is directed to a system for automatically declaring objects in code. Fig. 4 is a schematic diagram of the system 400. Specifically, the objects and code are in a project file, and the system 400 includes:
a first searching unit 402, configured to search for an object in the project file that has the same parent node as the code.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code. More specifically, finding objects in the project file that are at the same level as the code includes finding objects in the project file that are in the same folder as the code.
Generally, when a user ranks the hierarchical relationships of objects in an engineering file, the user tends to place objects and code having a logical relationship together for later ease of lookup and reference, i.e., the objects have the same parent node, are at the same level, or are in the same folder as the code in the engineering file. Thus, by the first lookup unit 402, objects and code having a logical relationship can be found, which are the most likely objects to be referred to by the code.
A first declaring unit 404, configured to declare a reference name of an object having the same parent node in the code as an object name of the object in the engineering document. Through the first declaration unit 404, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the system 400 can automatically declare code objects and/or non-code objects in the code.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
A fifth embodiment of the invention is directed to a system for automatically declaring objects in code. Fig. 5 is a schematic diagram of the system 500. Specifically, the objects and code are in a project file, and the system 500 includes:
a second finding unit 502 for finding objects with global declaration properties.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy. More specifically, locating objects in the project file that are in the global claim hierarchy includes locating objects in the project file that are in the global claim folder.
In general, some objects are referenced not only in one code, but often in multiple codes, and when a user ranks the objects in a hierarchical relationship in the project file, the user tends to set a special attribute for the objects, i.e., a global declaration attribute, that indicates that the objects are likely to be referenced in all or part of the code, or the user tends to place the objects separately, i.e., at the global declaration level or in the global declaration folder in the project file, for differentiation. Thus, by means of the second lookup unit 502, objects that are likely to be referenced in all or part of the code can be found.
A second declaring unit 504, configured to declare a reference name of an object having a global declaration attribute in code as an object name of the object in the project file. Through the second declaration unit 504, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the system 500 can automatically declare code objects and/or non-code objects in the code.
The second embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the second embodiment. The related technical details mentioned in the second embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the second embodiment.
A sixth embodiment of the invention is directed to a system for automatically declaring objects in code. Fig. 6 is a schematic diagram of the system 600. Specifically, the objects and code are in a project file, and the system 600 includes:
a first searching unit 402, configured to search for an object in the engineering file that has the same parent node as the code.
Optionally, finding objects in the engineering file that have the same parent node as the code comprises finding objects in the engineering file that are at the same level as the code. More specifically, finding objects in the project file that are at the same level as the code includes finding objects in the project file that are in the same folder as the code.
Generally, when a user ranks the hierarchical relationships of objects in an engineering file, the user tends to place objects and code having a logical relationship together for later ease of lookup and reference, i.e., the objects have the same parent node, are at the same level, or are in the same folder as the code in the engineering file. Thus, by the first lookup unit 402, objects and code having a logical relationship can be found, which are the most likely objects to be referred to by the code.
A first declaring unit 404, configured to declare a reference name of an object having the same parent node in the code as an object name of the object in the engineering document. Through the first declaration unit 404, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
A second finding unit 502 for finding objects with global declaration properties.
Optionally, finding objects with global claim properties comprises finding objects in the engineering document at a global claim hierarchy. More specifically, finding objects in the project file that are at the global claim level includes finding objects in the project file that are in the global claim folder.
In general, some objects are not only referenced in one code, but often in multiple codes, and when a user ranks the objects in a hierarchical relationship in an engineering document, the user tends to set a special attribute, i.e., a global declaration attribute, for the objects to distinguish, which indicates that the objects are likely to be referenced in all or part of the code, or to place the objects separately, i.e., at a global declaration level or in a global declaration folder in the engineering document. Thus, by means of the second lookup unit 502, objects that are likely to be referenced in all or part of the code can be found.
A second declaring unit 504, configured to declare a reference name of an object having a global declaration attribute in code as an object name of the object in the project file. Through the second declaration unit 504, the user can directly refer to the object name of the object in the project file in the code, thereby reducing the memory cost and the error probability.
Optionally, the objects include code objects and/or non-code objects. Thus, the system 600 can automatically declare code objects and/or non-code objects in code.
It is to be noted that the functions of the first lookup unit 402 and the second lookup unit 502 can also be implemented by one lookup unit, and the functions of the first declaration unit 404 and the second declaration unit 504 can also be implemented by one declaration unit.
The third embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the third embodiment. The related technical details mentioned in the third embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the third embodiment.
A seventh embodiment of the invention is directed to an apparatus for automatically declaring an object in code, the apparatus comprising a memory storing computer-executable instructions and a processor configured to execute the instructions to implement a method for automatically declaring an object in code.
The first embodiment, the second embodiment, or the third embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment may be implemented in cooperation with the first embodiment, the second embodiment, or the third embodiment. The related technical details mentioned in the first embodiment, the second embodiment, or the third embodiment are still valid in this embodiment, and are not described herein again in order to reduce the repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment or the second embodiment or the third embodiment.
An eighth embodiment of the present invention is directed to a non-transitory computer storage medium encoded with a computer program comprising instructions that are executed by one or more computers to implement a method of automatically declaring objects in code.
The first embodiment, the second embodiment, or the third embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment may be implemented in cooperation with the first embodiment, the second embodiment, or the third embodiment. The related technical details mentioned in the first embodiment, the second embodiment, or the third embodiment are still valid in this embodiment, and are not described herein again in order to reduce the repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment or the second embodiment or the third embodiment.
Each method embodiment of the present invention can be implemented by software, hardware, firmware, or the like. Whether the present invention is implemented as software, hardware, or firmware, the instruction code may be stored in any type of computer-accessible memory (e.g., permanent or modifiable, volatile or non-volatile, solid or non-solid, fixed or removable media, etc.). Also, the Memory may be, for example, Programmable Array Logic (PAL), Random Access Memory (RAM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic disk, an optical disk, a Digital Versatile Disk (DVD), or the like.
It should be noted that, each unit/module mentioned in each device embodiment of the present invention is a logical unit/module, and physically, one logical unit may be one physical unit, or may be a part of one physical unit, or may be implemented by a combination of multiple physical units, and the physical implementation manner of these logical units itself is not the most important, and the combination of the functions implemented by these logical units is the key to solve the technical problem provided by the present invention. Furthermore, the above-mentioned embodiments of the apparatus of the present invention do not introduce elements that are less relevant for solving the technical problems of the present invention in order to highlight the innovative part of the present invention, which does not indicate that there are no other elements in the above-mentioned embodiments of the apparatus.
It is to be noted that in the claims and the description of the present patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the verb "comprise a" to define an element does not exclude the presence of another, same element in a process, method, article, or apparatus that comprises the element.
While the invention has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (8)

1. A method for automatically declaring objects in code, the objects and code being in an engineering file, the method comprising:
searching the object which has the same father node with the code in the engineering file;
declaring the reference name of the object with the same parent node in the code as the object name of the object in the engineering file;
and/or finding the object with a global declaration attribute;
declaring the reference name of the object with the global declaration attribute in the code as the object name of the object in the project file;
wherein the object comprises a code object and/or a non-code object.
2. The method of claim 1, wherein finding the object in the engineering file having the same parent node as the code comprises finding the object in the engineering file at the same level as the code.
3. The method of claim 1, wherein finding the object having a global claim attribute comprises finding the object at a global claim level in the engineering document.
4. A system for automatically declaring objects in code, the objects and code being in an engineering file, the system comprising:
the first searching unit is used for searching the object which has the same father node with the code in the engineering file;
a first declaring unit, configured to declare a reference name of the object in the code, where the object has the same parent node, as an object name of the object in the project file;
and/or a second search unit for searching for the object having a global declaration attribute;
a second declaration unit, configured to declare a reference name of the object with a global declaration attribute in the code as an object name of the object in the project file;
wherein the object comprises a code object and/or a non-code object.
5. The system of claim 4, wherein finding the object in the engineering file having the same parent node as the code comprises finding the object in the engineering file at the same level as the code.
6. The system of claim 4, wherein finding the object having a global claim attribute comprises finding the object at a global claim level in the project file.
7. An apparatus for automatically declaring an object in code, the apparatus comprising a memory storing computer-executable instructions and a processor configured to execute the instructions to implement a method of automatically declaring an object in code according to any one of claims 1-3.
8. A non-transitory computer storage medium encoded with a computer program, the computer program comprising instructions that are executed by one or more computers to implement the method of automatically declaring an object in code according to any one of claims 1-3.
CN201811028758.0A 2018-09-03 2018-09-03 Method, system, apparatus and medium for automatically declaring objects in code Active CN109324794B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811028758.0A CN109324794B (en) 2018-09-03 2018-09-03 Method, system, apparatus and medium for automatically declaring objects in code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811028758.0A CN109324794B (en) 2018-09-03 2018-09-03 Method, system, apparatus and medium for automatically declaring objects in code

Publications (2)

Publication Number Publication Date
CN109324794A CN109324794A (en) 2019-02-12
CN109324794B true CN109324794B (en) 2022-05-06

Family

ID=65264654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811028758.0A Active CN109324794B (en) 2018-09-03 2018-09-03 Method, system, apparatus and medium for automatically declaring objects in code

Country Status (1)

Country Link
CN (1) CN109324794B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211273B (en) * 2006-12-25 2010-05-19 上海科泰世纪科技有限公司 Method for automatic creation for Singleton mode in component programming
US8260784B2 (en) * 2009-02-13 2012-09-04 International Business Machines Corporation Indexing and searching JSON objects
US8881121B2 (en) * 2009-02-18 2014-11-04 International Business Machines Corporation Processing an object-oriented query to retrieve data from a data source
CN101799753B (en) * 2009-12-17 2013-01-16 中国电力科学研究院 Method and device for realizing tree structure
CN102629204B (en) * 2012-03-09 2015-07-29 中国联合网络通信集团有限公司 Web page source code generation method and device
CN104360870B (en) * 2014-12-03 2018-07-17 北京和利时系统工程有限公司 A kind of method and apparatus for realizing object modeling
CN105224377B (en) * 2015-10-08 2018-07-10 广州华旻信息科技有限公司 A kind of method and device by metadata automatic generating software project code file
CN107357942A (en) * 2017-09-04 2017-11-17 山东达创网络科技股份有限公司 A kind of source code auxiliary Core Generator and its generation method

Also Published As

Publication number Publication date
CN109324794A (en) 2019-02-12

Similar Documents

Publication Publication Date Title
CN107526777B (en) Method and equipment for processing file based on version number
CN109766341B (en) Method, device and storage medium for establishing Hash mapping
CN106547572B (en) program file comparison method and device
US7523288B2 (en) Dynamic fragment mapping
US7895211B2 (en) Method and system for reinserting a chain in a hash table
CN108881120B (en) Data processing method and device based on block chain
US7769719B2 (en) File system dump/restore by node numbering
CN103744628A (en) SSTable file storage method and device
CN103176828A (en) Method and device of deleting application program residual files
CN105550306A (en) Multi-copy data reading/writing method and system
CN111414228B (en) Method and related device for managing storage space based on Kubernetes
CN103577546A (en) Method and equipment for data backup, and distributed cluster file system
CN109460406B (en) Data processing method and device
CN112860312A (en) Method and device for detecting item dependency relationship change
US20080307013A1 (en) Updating an inverted index
CN106933842B (en) Database query method and device
CN103135947B (en) A kind of method and apparatus showing Windows drive
CN107609011B (en) Database record maintenance method and device
CN113515303B (en) Project transformation method, device and equipment
CN109324794B (en) Method, system, apparatus and medium for automatically declaring objects in code
CN101702180B (en) Method and system for searching associated field value
US20090157770A1 (en) Live Volume Access
CN109783274B (en) Disk snapshot management method and device and readable storage medium
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN115203209A (en) List dividing method and device based on hibernate interceptor, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant