Method for designing plug-in type multi-language code editor based on grammar protocol
1. A method for designing a plug-in multi-language code editor based on a grammar protocol comprises the following steps:
s1: preparing for work; the system comprises a language input module, a plug-in conversion program, a conversion component, a converted component and a transmission module;
s2: inputting the logic instruction into a plug-in converting program through a language input module;
s3: the plug-in conversion program sets instruction sending logic, and the conversion component sends a conversion instruction;
s4: collecting the multilingual conversion instructions at the same time, and packaging the instructions to issue the conversion instructions;
s5: the plug-in conversion program checks and uploads the data;
s6: transmitting the data into a transmission module, analyzing the data and recording the data;
s7: and editing the data, correcting the multilingual data and exporting the language data.
2. The method according to claim 1, wherein the step S2 further comprises:
s201: the first instruction set carries out language identification conversion;
s202: the second instruction set carries out language labeling conversion;
s203: the third instruction set carries out language error screening test;
s204: performing language identification, language labeling and language error screening tests on all instruction sets, and then performing instruction summarizing tests;
s205: the instruction set is stored.
3. The method according to claim 1, wherein the step S5 further comprises:
s501: the plug-in conversion program directly calls the related data of the conversion component and the converted component;
s502: issuing an instruction;
s503: the uploaded data is checked.
4. The method of claim 1, wherein in step S205, the data of all instruction sets are stored by c, cpp, java and python.
5. The method as claimed in claim 1, wherein in steps S1-S7, the tested components with different functions and the language commands with different types only need to modify the conversion instruction set and the logic in part of the conversion software, so as to achieve the purpose of fast execution of automatic conversion.
Background
The code is a source file written by a programmer by a language supported by a development tool, is a group of definite rule systems which express information in a discrete form by characters, symbols or signal code elements, and in the process of editing multi-language codes, an editor cannot operate the codes through a single instruction due to excessive code types.
Patent No. CN201611227214.8 discloses an editor-based international code conversion method, S501: detecting that an internationalized configuration file editor and a code editor are simultaneously opened; s502: detecting whether a code is dragged and dropped to an internationalized configuration file editor area; if there has been no drag and drop, the close detection is performed at S511; s503: acquiring a code dragged and dropped to an internationalized configuration file editor; s504: judging whether a code dragged and dropped to an internationalized configuration file editor has a language needing internationalization; if the judgment result is negative, executing S505; if the judgment result is yes, executing S506; s505: if the internationalization code is not needed, prompting that the internationalization code is not needed; returning to S502 … … the invention solves the problem that when a place needs to be adjusted, the place needing to be modified can be quickly and effectively modified, and all the places are saved after the editing is confirmed to be satisfactory, but the multi-language can not be simultaneously identified, tested and converted.
To solve the above problem, we propose a method for designing a plug-in multilingual code editor based on a grammar protocol.
Disclosure of Invention
The invention aims to solve the defects in the prior art and provides a method for designing a plug-in multi-language code editor based on a grammar protocol.
In order to achieve the purpose, the invention adopts the following technical scheme: a method for designing a plug-in multi-language code editor based on a grammar protocol comprises the following steps:
s1: preparing for work; the system comprises a language input module, a plug-in conversion program, a conversion component, a converted component and a transmission module;
s2: inputting the logic instruction into a plug-in converting program through a language input module;
s3: the plug-in conversion program sets instruction sending logic, and the conversion component sends a conversion instruction;
s4: collecting the multilingual conversion instructions at the same time, and packaging the instructions to issue the conversion instructions;
s5: the plug-in conversion program checks and uploads the data;
s6: transmitting the data into a transmission module, analyzing the data and recording the data;
s7: and editing the data, correcting the multilingual data and exporting the language data.
Preferably, step S2 further includes:
s201: the first instruction set carries out language identification conversion;
s202: the second instruction set carries out language labeling conversion;
s203: the third instruction set carries out language error screening test;
s204: performing language identification, language labeling and language error screening tests on all instruction sets, and then performing instruction summarizing tests;
s205: the instruction set is stored.
Preferably, step S5 further includes:
s501: the plug-in conversion program directly calls the related data of the conversion component and the converted component;
s502: issuing an instruction;
s503: the uploaded data is checked.
Preferably, in step S205, data of all instruction sets are stored through c, cpp, java, and python.
Preferably, in steps S1-S7, the tested components with different functions and the language instructions with different types only need to modify the conversion instruction set and the logic in the partial conversion software, so as to achieve the purpose of quickly executing the automatic conversion.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention provides a plug-in type multi-language code editor design method based on a grammatical protocol, which is characterized in that a logic instruction is input into a plug-in conversion program through a language input module, a first instruction set carries out language identification conversion, a second instruction set carries out language labeling conversion, a third instruction set carries out language error screening test, instruction summarizing test is carried out after all instruction sets carry out language identification, language labeling and language error screening test, the instruction sets are stored, and data of all instruction sets are stored through c, cpp, java and python.
2. The invention provides a plug-in type multi-language code editor design method based on a grammar protocol, a plug-in conversion program sets instruction sending logic, a conversion component sends a conversion instruction, the multi-language conversion instruction is collected at the same time, the instruction is packaged and issued to the conversion instruction, the plug-in conversion program checks and uploads data, the plug-in conversion program directly calls related data of the conversion component and a converted component, the instruction is issued, the uploaded data is checked, the data is transmitted to a transmission module, the data is analyzed and recorded, the data is edited, the multi-language data is corrected, language data is exported, tested components with different functions and different types of language instructions only need to modify a conversion instruction set and part of the logic in conversion software, and the purpose of quickly executing automatic conversion can be achieved.
Drawings
FIG. 1 is a general flowchart of a method for designing a plug-in multilingual code editor based on a grammar protocol according to the present invention;
FIG. 2 is a schematic view of the leakage preventing mechanism.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Examples
Referring to fig. 1 and 2, a method for designing a plug-in multi-language code editor based on a syntax protocol includes the steps of:
s1: preparing for work; the system comprises a language input module, a plug-in conversion program, a conversion component, a converted component and a transmission module;
s2: inputting the logic instruction into a plug-in converting program through a language input module;
in step S2, the method further includes:
s201: the first instruction set carries out language identification conversion;
s202: the second instruction set carries out language labeling conversion;
s203: the third instruction set carries out language error screening test;
s204: performing language identification, language labeling and language error screening tests on all instruction sets, and then performing instruction summarizing tests;
s205: storing the instruction set;
in step S205, the data of all instruction sets are stored through c, cpp, java and python
S3: the plug-in conversion program sets instruction sending logic, and the conversion component sends a conversion instruction;
s4: collecting the multilingual conversion instructions at the same time, and packaging the instructions to issue the conversion instructions;
s5: the plug-in conversion program checks and uploads the data;
s501: the plug-in conversion program directly calls the related data of the conversion component and the converted component;
s502: issuing an instruction;
s503: the uploaded data is checked.
S6: transmitting the data into a transmission module, analyzing the data and recording the data;
s7: and editing the data, correcting the multilingual data and exporting the language data.
The tested components with different functions and different language instructions can achieve the aim of quickly executing automatic conversion only by modifying the conversion instruction set and partially converting the logic in software.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.
In the description of the present invention, it is to be understood that the terms indicating an orientation or positional relationship are based on the orientation or positional relationship shown in the drawings only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:页面元素的编辑方法、装置、存储介质及终端