A method and terminal for realizing graphical programming
By building a language tree and performing code conversion, the problem that the existing technology cannot be compatible with the unity engine is solved, and the conversion from C# language to lua/python language is realized. The generated code runs directly in the unity engine and physical robots, taking into account actual business needs and improving the usability and compatibility of the code.
Patent Information
- Application Number
- CN202010952665.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-11
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2040-09-11
AI Technical Summary
The existing technology cannot be perfectly compatible with the unity engine. The generated python code is prone to errors when it is actually run, and does not consider the actual business scenario and the relationship between global variables and local variables.
By obtaining the pre-set language tree, receiving graphical programming requests, finding the corresponding tree nodes for code conversion, and splicing and integrating the converted code according to the association relationship in the language tree to generate lua/python code that is compatible with the unity engine.
The conversion from C# language to lua/python language is implemented, ensuring that the generated code runs directly in the unity engine and physical robots, taking into account actual business needs, and the code availability and compatibility are improved.
Smart Images

Figure CN114168123B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graphical programming, and in particular to a method and a terminal for implementing graphical programming. Background Art
[0002] In the process of developing the robot project, it is necessary to use the Unity engine to develop a set of graphical programming applications, which requires that the graphical programming results can be simulated and run on Unity. This is because graphical programming can generate Python script classes, which can be provided offline to the physical robot for running.
[0003] The existing technologies are all products that are expanded based on the source code of scratch or blockly (Google source code), and the languages used are js and html, which are not perfectly compatible with the unity engine. The python code generated by this adds while loops and coroutines, which are prone to errors during actual operation. The code does not consider direct references to actual business scenarios. At the same time, the generated python code does not reflect the relationship between global variables and local variables. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for realizing graphical programming so as to be perfectly compatible with the unity engine.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A method for implementing graphical programming, comprising:
[0007] S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code;
[0008] S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated;
[0009] S3. Find the tree nodes corresponding to each building block in the graphic building block combination from the language tree, perform code conversion corresponding to the script language type on the corresponding tree nodes, splice and integrate the converted codes according to the association relationship between the tree nodes in the language tree, and obtain and output the integrated code.
[0010] The beneficial effects of the present invention are: a method and terminal for realizing graphical programming, a user writes a syntax block in C#, splits the syntax block, constructs a syntax tree structure, makes the syntax block correspond to the corresponding node in the syntax tree, the client receives the graphic request event code clicked by the user, passes the code of the graphic request event into the corresponding syntax block in the syntax tree, parses the nodes in the syntax tree according to the type of script language to be converted by the user, switches to the corresponding code converter for language conversion, and outputs the final generated code. Thus, the conversion from C# language to Lua / Python language is realized, and C# language is used as the underlying language, which is a native support language of Unity, and can be perfectly compatible with Unity engine and most cross-platform applications. The Lua / Python syntax generated in this way takes into account the actual business needs, and the Unity engine and the physical robot directly run the simulation with the generated script, which can ensure the availability of the syntax. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A main flow chart of a method for implementing graphical programming according to an embodiment of the present invention;
[0012] Figure 2 A node composition diagram of a method for implementing graphical programming according to an embodiment of the present invention;
[0013] Figure 3 A diagram showing the results of a method for implementing graphical programming according to an embodiment of the present invention;
[0014] Figure 4 A python script generated for a method for implementing graphical programming according to an embodiment of the present invention;
[0015] Figure 5 A bottom-level overall structural design diagram of a method for implementing graphical programming according to an embodiment of the present invention;
[0016] Figure 6 A code conversion relationship diagram of a method for implementing graphical programming according to an embodiment of the present invention;
[0017] Figure 7 A code generation flow chart of a method for implementing graphical programming according to an embodiment of the present invention;
[0018] Figure 8 A diagram showing the relationship between modules of a method for implementing graphical programming according to an embodiment of the present invention;
[0019] Fig. 9 A schematic diagram of the formation of a user behavior and a language tree for a method for implementing graphical programming according to an embodiment of the present invention;
[0020] Fig.10A schematic diagram of the structure of a terminal for implementing graphical programming according to the present invention;
[0021] Description of labels:
[0022] 1. A terminal for implementing graphical programming; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0023] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0024] like Figures 1 to 9 As shown, the present invention provides a method for implementing graphical programming, comprising:
[0025] S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code;
[0026] S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated;
[0027] S3. Find the tree nodes corresponding to each building block in the graphic building block combination from the language tree, perform code conversion corresponding to the script language type on the corresponding tree nodes, splice and integrate the converted codes according to the association relationship between the tree nodes in the language tree, and obtain and output the integrated code.
[0028] From the above description, it can be seen that the beneficial effect of the present invention is that: the user uses C# to write a syntax block, splits the syntax block, constructs a syntax tree structure, makes the syntax block correspond to the corresponding node in the syntax tree, the client receives the graphic request event code clicked by the user, passes the code of the graphic request event into the corresponding syntax block in the syntax tree, parses the nodes in the syntax tree according to the type of script language the user wants to convert, switches to the corresponding code converter for language conversion, and outputs the final generated code. Thus, the conversion from c# language to lua / python language is realized, and c# language is used as the underlying language, which is a native support language of unity, and can be perfectly compatible with the unity engine and most cross-platform applications. The lua / python syntax generated in this way takes into account the actual business needs. In the unity engine and the physical robot, the simulation is directly run with the generated script to ensure the availability of the syntax.
[0029] Furthermore, the tree nodes are specifically:
[0030] Each of the tree nodes includes node attributes and a node unique name, wherein the node unique name is used to find a corresponding code converter when performing code conversion;
[0031] Each of the tree nodes is split into multiple forks according to the original logic of the C# language code, each fork is provided with a fork attribute, and each of the tree nodes is associated with other tree nodes through the fork attribute.
[0032] From the above description, it can be seen that each tree node has two attributes, namely the node type and the node unique name, and the syntax converter of the node is found through the node unique name. Each fork is provided with a fork attribute, which is helpful to determine whether subsequent nodes can be combined together.
[0033] Furthermore, the scripting language type is specifically a Lua scripting language or a Python scripting language. As can be seen from the above description, there are multiple scripting languages that can be selected for conversion, which can be a Lua scripting language or a Python scripting language.
[0034] Furthermore, the splicing and integration is specifically as follows:
[0035] According to the depth of the tree node, a code snippet is generated and an indentation depth is added, and syntax parsing is recursively performed layer by layer according to the bifurcation properties of each bifurcation under the tree node, so as to integrate all the code snippets according to the organizational flow in the original logic of the C# language code to form a complete code.
[0036] From the above description, we can see that using the depth of the tree where the node is located as a reference for code indentation is more organized, less prone to errors, and the generated code is more in line with the specification.
[0037] Furthermore, the code conversion is specifically as follows:
[0038] The tree node obtains the corresponding code converter to perform code conversion according to the unique name of the node and the type of script language to be generated.
[0039] From the above description, it can be seen that the corresponding code converter is obtained through the unique name of the node and the type of script language to be generated to perform code conversion, so that the contents of different tree nodes are respectively converted into code and then assembled into a complete code through the relationship between the nodes, so as to improve the code conversion efficiency.
[0040] like Fig.10 As shown, a terminal for implementing a graphical programming application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0041] S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code;
[0042] S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated;
[0043] S3. Find the tree nodes corresponding to each building block in the graphic building block combination from the language tree, perform code conversion corresponding to the script language type on the corresponding tree nodes, splice and integrate the converted codes according to the association relationship between the tree nodes in the language tree, and obtain and output the integrated code.
[0044] From the above description, it can be seen that the beneficial effect of the present invention is that: the user uses C# to write a syntax block, splits the syntax block, constructs a syntax tree structure, makes the syntax block correspond to the corresponding node in the syntax tree, the server receives the graphic request event code clicked by the user, passes the code of the graphic request event into the corresponding syntax block in the syntax tree, parses the nodes in the syntax tree according to the type of script language the user wants to convert, switches to the corresponding code converter for language conversion, and outputs the final generated code. Thus, the conversion from c# language to lua / python language is realized, and c# language is used as the underlying language, which is a native support language of unity, and can be perfectly compatible with the unity engine and most cross-platform applications. The lua / python syntax generated in this way takes into account the actual business needs. In the unity engine and the physical robot, the simulation is directly run with the generated script, which can ensure the availability of the syntax.
[0045] Furthermore, the tree nodes are specifically:
[0046] Each of the tree nodes includes node attributes and a node unique name, wherein the node unique name is used to find a corresponding code converter when performing code conversion;
[0047] Each of the tree nodes is split into multiple forks according to the original logic of the C# language code, each fork is provided with a fork attribute, and each of the tree nodes is associated with other tree nodes through the fork attribute.
[0048] From the above description, it can be seen that each tree node has two attributes, namely the node type and the node unique name, and the syntax converter of the node is found through the node unique name. Each fork is provided with a fork attribute, which is helpful to determine whether subsequent nodes can be combined together.
[0049] Furthermore, the scripting language type is specifically a lua scripting language or a python scripting language. As can be seen from the above description, there are multiple scripting languages that can be selected for conversion, which can be a lua scripting language or a python scripting language.
[0050] Furthermore, the splicing and integration is specifically as follows:
[0051] According to the depth of the tree node, a code snippet is generated and an indentation depth is added, and syntax parsing is recursively performed layer by layer according to the bifurcation properties of each bifurcation under the tree node, so as to integrate all the code snippets according to the organizational flow in the original logic of the C# language code to form a complete code.
[0052] From the above description, we can see that using the depth of the tree where the node is located as a reference for code indentation is more organized and less prone to errors.
[0053] Furthermore, the code conversion is specifically as follows:
[0054] The tree node obtains the corresponding code converter to perform code conversion according to the unique name of the node and the type of script language to be generated.
[0055] It can be seen from the above description that by obtaining the corresponding code converter through the unique name of the node and the type of script language to be generated to perform code conversion, it is not easy to cause content conversion errors.
[0056] Please refer to Figures 1 to 9 , Embodiment 1 of the present invention is:
[0057] A method for implementing graphical programming, comprising:
[0058] S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code;
[0059] In this embodiment, the user connects the split nodes to form a language tree structure (language tree: a complete code structure, a kind of associated tree structure constructed by the code fragments contained). When connecting tree nodes, the attributes of the forks are set to determine whether two tree nodes can be connected together. Integrating multiple tree nodes can form a local code block logic.
[0060] Among them, Figure 5 As shown, building a language tree includes the following steps:
[0061] 1. Language behavior splitting - converted into tree nodes,
[0062] Such as: adding list elements, whether the list contains elements, inserting values into the list, getting values from the list, getting element index from the list, method expressions, Boolean expressions, function comparison expressions, AND or OR operation expressions, if logical expressions, etc.
[0063] 2. The attributes of the tree node include:
[0064] Tree node fork type tag, tree node type tag and tree node fork can place range tag, where,
[0065] The tree node type tag and the tree node fork can be placed in the range tag to determine whether the tree node is connectable.
[0066] 3. The operations between tree nodes are as follows:
[0067] Connection between tree nodes, disconnection between tree nodes, connectability judgment of tree nodes, fork retrieval of tree nodes and expansion of dynamic fork of tree nodes.
[0068] Through the above steps, a language tree is formed.
[0069] S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated;
[0070] In this embodiment, if Figure 3 As shown, when the user is in the graphical programming interface, he will combine the graphical building blocks and select the type of script language to be generated, and then send a graphical programming request. The script language type is Lua script language or Python script language, such as Figure 4 The following is the final generated Python script language. Fig. 9 Shown is a schematic diagram of user behavior and language tree formation.
[0071] S3. Find the tree nodes corresponding to each building block in the graphic building block combination from the language tree, perform code conversion corresponding to the script language type on the corresponding tree nodes, splice and integrate the converted codes according to the association relationship between the tree nodes in the language tree, and obtain and output the integrated code.
[0072] In this embodiment, the language tree is parsed from the root node, and each node is switched to the corresponding code converter. According to the depth of the node, the generated code snippet is added with the indentation depth. Finally, all the generated codes are integrated together according to the organization process to form a complete code snippet. The code is output in text form.
[0073] The tree nodes are specifically:
[0074] Each of the tree nodes includes node attributes and a node unique name, wherein the node unique name is used to find a corresponding code converter when performing code conversion;
[0075] Each of the tree nodes is split into multiple forks according to the original logic of the C# language code, each fork is provided with a fork attribute, and each of the tree nodes is associated with other tree nodes through the fork attribute.
[0076] Specifically, Figure 2 As shown, the syntax is split:
[0077] 1.1 Building tree nodes
[0078] Each tree node represents a syntax block with decomposition.
[0079] Among them, the syntax block is a fragment that makes up the code. The user writes a complete piece of code that includes many independent elements. For example, the judgment logic in the code: if (a==b) then
[0080] Dosomething()
[0081] end
[0082] Here you can split multiple syntax blocks:
[0083] Syntax block 1: if() then
[0084] end
[0085] Syntax block 2: if condition: xxx==xxx;
[0086] Syntax block 3: In the condition, a and b can exist as variable syntax blocks
[0087] Quick Syntax 4: Dosomething()
[0088] In summary, a syntax block is a series of code snippets.
[0089] The forks of the tree nodes represent the objects that the grammar splits into.
[0090] The splitting is to list the elements contained in each syntax block according to the combination rules of the code.
[0091] end
[0092] The logic of if is split into two forks, the execution condition of if is one fork, and the execution content of if is another fork, both of which can be spliced with other nodes. If continues to expand, the content also includes the fork of elseif and the fork setting of else.
[0093] Each tree node has two common attributes: type (tree node type) and nodename (tree node unique name, which can be used to specify the syntax converter to the tree node when generating syntax);
[0094] Among them, the syntax converter is an interface converted into a specific language: such as the if logic block node, the C# node expression is Condition: xxx; Content: xxx; the generated Lua has a corresponding interface, and the internal if logic is generated, and the final generation is: if (Condition) then Content end; the generated Python has a corresponding interface, and the final generation is: if (Condition): Content.
[0095] Each tree node can be split into multiple forks. A fork is set with a type, i.e., a fork attribute, to determine whether the type of subsequent nodes can be combined under the fork.
[0096] Among them, the inclusion type is an inclusion type that is set: such as the if logic block: there are 2 forks Condition: xxx; Content: xxx; If's judgment condition Condition can be placed with a bool variable, a condition judgment method, etc.; only tree nodes that meet the above types can be set there.
[0097] Split from the above syntax blocks, the following examples are provided for reference:
[0098] Split without callback method:
[0099] type:voidnode
[0100] nodename:voidFunc
[0101] Forks (3):
[0102] functionName(method name)
[0103] Params
[0104] Body (method content implementation)
[0105] 1.2 Tree node type
[0106] String
[0107] Number (value, int and float are both replaced by this type)
[0108] Bool (Boolean variable)
[0109] Array
[0110] Variable
[0111] Color
[0112] Null
[0113] VoidFunc (method)
[0114] Dosomething
[0115] 1.3 Node Tree Combination
[0116] The combination of tree nodes is achieved by adding tree nodes to tree node forks.
[0117] The bifurcation of tree nodes can be divided into three categories:
[0118] Fork of the mount leaf (setting value)
[0119] General fork (nodes can be set)
[0120] Dynamic forking (dynamic expansion of the number of forks)
[0121] Generally, a fork has a fixed number of forks. For example, the if condition and execution content mentioned above are fixed.
[0122] Fork: The attributes of a tree node, such as the fork of an if node can be divided into:
[0123] if condition (general fork)
[0124] If execution content (generally fork)
[0125] Else execution content (general fork)
[0126] Because the elseif of if logic is not fixed, there may be multiple elseifs. The conditions and execution contents under elseif are called dynamic forks.
[0127] Wherein, the splicing integration is specifically as follows:
[0128] According to the depth of the tree node, a code snippet is generated and an indentation depth is added, and syntax parsing is recursively performed layer by layer according to the bifurcation properties of each bifurcation under the tree node, so as to integrate all the code snippets according to the organizational flow in the original logic of the C# language code to form a complete code.
[0129] like Figure 6 This is a code conversion relationship diagram, specifically:
[0130] a. The tree node is passed the Nodename and the language type (lua / python) that needs to be converted.
[0131] What is described here is that each language block, such as if logic, has its own corresponding Lua and Python converters. Code conversion is to first find the code converter corresponding to each tree node to generate code fragments, and finally integrate them into a complete code.
[0132] b. According to the set fork attribute, here it means that if the condition of the if logic is parsed, the code converter corresponding to the condition will be switched to generate the code snippet of the condition according to the tree node connected to the condition, and finally integrated into the if logic; the connection process of the tree node is the user behavior of graphical programming, and this association is established by connecting several building blocks. Perform grammar parsing recursively layer by layer, such as: parsing to the condition of the if logic; the if condition is a condition determination method, the code generator of the condition determination method will be used, and there may be variable nodes in the condition determination method, and then the code is generated layer by layer, and finally integrated into the conditional code snippet of the if logic, which is used by the if logic to splice the complete code block.
[0133] c. The depth of the tree where the node is located is used as a reference for code indentation.
[0134] like Figure 7 As shown, the steps of code generation are:
[0135] 1. The user connects the split nodes to form a language tree structure.
[0136] 2. When connecting tree nodes, set the attributes based on the fork to determine whether two tree nodes can be connected together.
[0137] 3. Integrating multiple tree nodes can form a local code block logic.
[0138] 4. Select the type of script language to be generated, lua / python.
[0139] 5. The language tree is parsed starting from the root node, and each tree node switches to the corresponding code converter.
[0140] 6. Generate code snippets and add indent depth based on the depth of the tree node.
[0141] 7. Finally, all generated codes are integrated together according to the organizational process to form a complete code snippet.
[0142] 8. Output the code in text format.
[0143] Therefore, if Figure 8 As shown, this embodiment can be applied to the following scenarios:
[0144] 1. Graphical programming course, users use graphical building blocks to combine building blocks; the combined building blocks generate Lua language through this embodiment, and are loaded by Unity to drive the scene, character or AI in Unity to do editing feedback. The integer division process is the combination of building blocks, which corresponds to the splicing behavior of the language tree node, and then executes the code generation of the language tree. The generated code fragments are integrated together and can eventually be loaded and run by Unity.
[0145] 2. The combination generates Python, which will show the indentation depth of the code logic according to the depth of the node where the code block is located; finally, it is generated in a Python file as text and sent to the robot to load and run.
[0146] Embodiment 2 of the present invention is:
[0147] A terminal for implementing graphical programming includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned embodiment 1 are implemented.
[0148] In summary, the present invention provides a method and terminal for implementing graphical programming. The user uses C# to write a syntax block, splits the syntax block, and constructs a syntax tree structure so that the syntax block corresponds to the corresponding node in the syntax tree. The client receives the graphic request event code clicked by the user, and passes the code of the graphic request event into the corresponding syntax block in the syntax tree. According to the type of script language to be converted by the user, the nodes in the syntax tree are parsed, and the corresponding code converters are respectively switched to perform language conversion, and the final generated code is output. Each fork is provided with a fork attribute, which is conducive to judging whether subsequent nodes can be combined together. The depth of the tree where the node is located is used as a reference for code indentation, which is more organized, less prone to errors, and the generated code is more in line with the specification. The corresponding code converter is obtained through the unique name of the node and the type of script language to be generated to perform code conversion, so that the contents of different tree nodes are respectively converted into code and then assembled into a complete code through the relationship between nodes to improve the efficiency of code conversion. This enables the conversion from C# language to Lua / Python language. C# language is used as the underlying language, which is a native support language of Unity and is perfectly compatible with the Unity engine and most cross-platform applications. The Lua / Python syntax generated in this way takes actual business needs into consideration. The Unity engine and physical robots directly run simulations with generated scripts to ensure the availability of the syntax.
[0149] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for implementing graphical programming, characterized in that: include: S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code; Each of the tree nodes is split into multiple forks according to the original logic of the C# language code, each fork is provided with a fork attribute, and each of the tree nodes is associated with other tree nodes through the fork attribute; S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated; The scripting language type is specifically Lua scripting language or Python scripting language; S3. Finding a tree node corresponding to each building block in the graphic building block combination from the language tree, converting the corresponding tree nodes into codes corresponding to the script language type, splicing and integrating the converted codes according to the association relationship between the tree nodes in the language tree, and obtaining and outputting the integrated code; The splicing and integration is specifically to generate code snippets and add indentation depth according to the depth of the tree node, and recursively perform syntax parsing layer by layer according to the bifurcation properties of each bifurcation under the tree node, so as to integrate all code snippets together according to the organizational process in the original logic of the C# language code.
2. A method for implementing graphical programming according to claim 1, characterized in that: The tree nodes are specifically: Each of the tree nodes includes node attributes and a node unique name, and the node unique name is used to find the corresponding code converter when performing code conversion.
3. A method for implementing graphical programming according to claim 2, characterized in that: The code conversion is specifically as follows: The tree node obtains the corresponding code converter to perform code conversion according to the unique name of the node and the type of script language to be generated.
4. A terminal for implementing graphical programming, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. Obtain a preset language tree, wherein the language tree is a tree structure obtained by associating different basic syntax blocks with basic syntax blocks as tree nodes according to the original logic of the C# language code, wherein the basic syntax blocks are independent code fragments that can be decomposed from the C# language code; Each of the tree nodes is split into multiple forks according to the original logic of the C# language code, each fork is provided with a fork attribute, and each of the tree nodes is associated with other tree nodes through the fork attribute; S2. Receive a graphics programming request, obtain the graphics building block combination in the graphics programming request and the type of script language to be generated; The scripting language type is specifically Lua scripting language or Python scripting language; S3. Finding a tree node corresponding to each building block in the graphic building block combination from the language tree, converting the corresponding tree nodes into codes corresponding to the script language type, splicing and integrating the converted codes according to the association relationship between the tree nodes in the language tree, and obtaining and outputting the integrated code; The splicing and integration is specifically to generate code snippets and add indentation depth according to the depth of the tree node, and recursively perform syntax parsing layer by layer according to the bifurcation properties of each bifurcation under the tree node, so as to integrate all code snippets together according to the organizational process in the original logic of the C# language code.
5. A terminal for implementing graphical programming according to claim 4, characterized in that: The tree nodes are specifically: Each of the tree nodes includes node attributes and a node unique name, and the node unique name is used to find the corresponding code converter when performing code conversion.
6. A terminal for implementing graphical programming according to claim 5, characterized in that: The code conversion is specifically as follows: The tree node obtains the corresponding code converter to perform code conversion according to the unique name of the node and the type of script language to be generated.
Citation Information
Patent Citations
Programming and compiling design method in robot graphical programming system
CN104503754A
Multi-model-based C language program code specification construction method
CN107943481A