CN108563442A - Code compiling method and device - Google Patents
Code compiling method and device Download PDFInfo
- Publication number
- CN108563442A CN108563442A CN201810168956.0A CN201810168956A CN108563442A CN 108563442 A CN108563442 A CN 108563442A CN 201810168956 A CN201810168956 A CN 201810168956A CN 108563442 A CN108563442 A CN 108563442A
- Authority
- CN
- China
- Prior art keywords
- code
- completion
- stage
- write
- compiled
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Abstract
The invention discloses a kind of code compiling method and device, the method includes:It is periodically detected the code write;Judge whether stage writes completion to the code write;If stage writes completion, the code that completion is write to stage is compiled.The method of the present invention can realize automatic compiling, without artificial compiling, save time cost and human cost.
Description
Technical field
The present invention designs a calculating machine field, more particularly to a kind of code compiling method and device.
Background technology
Code is exactly the source file that the language supported of programmer's developing instrument writes out, and is one group by character, symbol
Or signal element indicates the specific rule system of information with discrete form.Compiling is to convert human-readable/code for writing to
The process for the binary instruction that computer class executes.
The compiling procedure of current code is typically hand-coding code, and then composing software hand-manipulated compiles code
It translates.With the development of demand, the complexity of the quantity of code is also gradually increasing, in the compiling procedure of code, constantly
It repeats compiling by hand and is bound to cause manpower and waste of time.
There are no a kind of code compiling methods for saving human cost and time cost in the prior art.
Invention content
The object of the present invention is to provide a kind of code compiling methods, which is characterized in that the method includes:
It is periodically detected the code write;
Judge whether stage writes completion to the code write;
If stage writes completion, the code that completion is write to stage is compiled.
Preferably, whether stage writes completion to the code for judging to have write, including:
According to code database, whether stage writes completion to the code write described in judgement.
Preferably, the code that completion is write to stage is compiled, including:
Obtain the initial row that the stage writes the code of completion;
Obtain the end line that the stage writes the code of completion;
Code between the initial row and end line is compiled.
Preferably, the code between initial row and end line is compiled, including:
Code copying between the initial row and end line to compiling area is compiled.
Preferably, described after the end line for obtaining the interim code for writing completion, the method further includes:
Setting terminates label after writing the end line of the code of completion in the stage.
Preferably, the initial row for obtaining stage and writing the code of completion, including:
The initial row of the code of completion is write using the last one the first row after terminating label as the stage.
Preferably, after the code between initial row and end line is compiled, the method further includes:
If compile error alerts.
Preferably, after the code between initial row and end line is compiled, the method further includes:
The compile error is stored in the form of text.
Second aspect, provides a kind of code compilation device, and described device includes:
Timer, for being periodically detected the code write;
Determining device, for judging whether stage writes completion to the code write;
Compiler, if writing completion for stage, the code that completion is write to stage is compiled.
Preferably, compiler is stated to be additionally operable to:
Obtain the initial row that the stage writes the code of completion;
Obtain the end line that the stage writes the code of completion;
The code between initial row and end line is compiled.
In the code compiling method of the embodiment of the present invention, it is first periodically detected the code write, then judges to have write
Code whether stage writes completion, if stage writes completion, the code of completion is write to stage and is compiled.This
The code that the method for inventive embodiments can periodically write stage completion is compiled automatically, without compiling of knocking off, therefore
Time cost and human cost are saved.
Description of the drawings
Fig. 1 show the flow chart of the code compiling method of the embodiment of the present invention;
Fig. 2 show the schematic diagram of one section of code of the embodiment of the present invention;
Fig. 3 show the structural schematic diagram of the code compilation device of the embodiment of the present invention.
Specific implementation mode
An embodiment of the present invention provides a kind of code compiling method and devices, can save time cost and human cost.
Fig. 1 show the flow chart of the code compiling method of the embodiment of the present invention, as shown in Figure 1, the method includes:
Step 110, it is periodically detected the code write.
In the embodiment of the present invention, detection cycle can be configured according to the personal habits of code writers.
Step 120, judge whether stage writes completion to the code write.
In step 120, whether stage writes completion to the code for judging to have write, including:
According to code database, whether stage writes completion to the code write described in judgement.
In the embodiment of the present invention, the code that stage writes completion refers to that the one of partial function, calculating etc. can be completed
Section code.
The end for the code that stage is completed can be specified completion character or complete character string, or can be that code is compiled
Write the label of personnel's setting or the end label of program setting.
Above-mentioned completion character or completion character string, the label being artificially arranged, end label all record in the database.
According to the record in database, character or completion character string are completed when detecting, or detect artificial setting
Label when, or can be detect program setting end label when, it is believed that this section of code write by stage
At.
Step 130, if stage writes completion, the code that completion is write to stage is compiled.
If it is being periodically detected the result is that stage write unfinished, code is not handled.
In step 130, the code that completion is write to stage is compiled, including:
Obtain the initial row that stage writes the code of completion;
Obtain the end line that stage writes the code of completion;
Code between the initial row and end line is compiled.
In the embodiment of the present invention, the code between initial row and end line refers to including initial row and end line
Code.
In the embodiment of the present invention, the code between initial row and end line is compiled, including:
Code copying between the initial row and end line to compiling area is compiled.
It a special compiling area is arranged to be compiled code, can not only complete to compile, but also will not be to writing
Code has an impact.
In the embodiment of the present invention, described after the end line for obtaining the interim code for writing completion, the method is also
Including:
Setting terminates label after writing the end line of the code of completion in the stage.
In the embodiment of the present invention, the initial row for obtaining stage and writing the code of completion, including:
The initial row of the code of completion is write using the last one the first row after terminating label as the stage.
In the embodiment of the present invention, after step 130, the code between initial row and end line is compiled it
Afterwards, the method further includes:
If compile error alerts.
In the embodiment of the present invention, after the code between initial row and end line is compiled, the method is also
Including:
The compile error is stored in the form of text.
The code compiling method of the embodiment of the present invention is, it can be achieved that automatic compiling has saved time cost without artificial compiling
And human cost.
Fig. 2 show the schematic diagram of one section of code of the embodiment of the present invention, as shown in Fig. 2, 210 be the initial row of code;
220 be specific character string, and indicate code phase writes completion;230 be to terminate label;240 and 250 are artificially arranged
Label indicates that code phase writes completion.
A1 is at the time of being periodically detected for the first time, and A2 is at the time of being periodically detected for the second time, and A3 is the third time period
Property detection at the time of.
It when code starts to write, is detected for the first time at the A1 moment, at this time and stage is not detected writes completion, therefore
The A1 moment does not deal with code.
Second is carried out at the A2 moment to detect, detects specific character string 220, then where artificial character string 220
Row is end line.Then to the code between 210 to 220, including 210 and 220 are compiled.
After the completion of being compiled to code at the A2 moment, the setting end label 230 after 220.
At the A3 moment, the label being artificially arranged at 240 and 250 liang is detected.
Two sections of interim codes completed are detected at the A3 moment, can be separated and are compiled, can also disposably compile.
Code between separately compiling is from rear a line to 230 to 240 is compiled, and is set after 240 after the completion of compiling
Completion label is set, then 240 rear a line to the code between 250 is compiled again.
Separate the code segment that Compilation Method is readily found error in compiling error.
Disposable compiling refers to being compiled to 230 rear a line to the code between 250.
Disposable Compilation Method can save the time.
The method of the method present invention of the embodiment of the present invention can realize automatic compiling, without artificial compiling, save the time
Cost and human cost.
Fig. 3 show the schematic diagram of the code compilation device of the embodiment of the present invention, as shown in figure 3, described device includes:
Timer 310, for being periodically detected the code write;
Determining device 320, for judging whether stage writes completion to the code write;
Compiler 330, if writing completion for stage, the code that completion is write to stage is compiled.
Preferably, the determining device 320 is additionally operable to:
According to code database, whether stage writes completion to the code write described in judgement.
Preferably, the compiler 330 is additionally operable to:
Obtain the initial row that stage writes the code of completion;
Obtain the end line that stage writes the code of completion;
Code between the initial row and end line is compiled.
Preferably, the compiler 330 is additionally operable to:
Code copying between the initial row and end line to compiling area is compiled.
Preferably, the compiler 310 is additionally operable to after the end line for obtaining the interim code for writing completion, in institute
Setting terminates label after stating the end line of the interim code for writing completion.
Preferably, the compiler 310 is additionally operable to:
The initial row of the code of completion is write using the last one the first row after terminating label as the stage.
Preferably, the compiler 310 is additionally operable to:
After the code between initial row and end line is compiled, the method further includes:
If compile error alerts.
Preferably, the compiler 310 is additionally operable to:
The compile error is stored in the form of text.
The device of the invention can realize automatic compiling, without artificial compiling, save time cost and human cost.
An embodiment of the present invention provides a kind of code compiling method and device, the method includes:It is periodically detected and has compiled
The code write;Judge whether stage writes completion to the code write;If stage writes completion, stage has been write
At code be compiled.Described device includes:Timer, for being periodically detected the code write;Determining device, for sentencing
Whether stage writes completion to the disconnected code write;Compiler has write stage if writing completion for stage
At code be compiled.The method of the present invention can realize automatic compiling, without artificial compiling, save time cost and manpower
Cost.
Specific case used herein elaborates inventive concept, the explanation of above example is only intended to
Help understands core of the invention thought.It should be pointed out that for those skilled in the art, not departing from this
Under the premise of inventive concept, any obvious modification, equivalent replacement or the other improvements made should be included in the present invention
Protection domain within.
Claims (10)
1. a kind of code compiling method, which is characterized in that the method includes:
It is periodically detected the code write;
Judge whether stage writes completion to the code write;
If stage writes completion, the code that completion is write to the stage is compiled.
2. the method as described in claim 1, which is characterized in that the code for judging to have write whether write by stage
At, including:
According to code database, whether stage writes completion to the code write described in judgement.
3. the method as described in claim 1, which is characterized in that the code for writing completion to stage is compiled, and is wrapped
It includes:
Obtain the initial row that the stage writes the code of completion;
Obtain the end line that the stage writes the code of completion;
Code between the initial row and end line is compiled.
4. method as claimed in claim 3, which is characterized in that the code between initial row and end line is compiled
It translates, including:
Code copying between the initial row and end line to compiling area is compiled.
5. method as described in claim 3 or 4, which is characterized in that described in the knot for obtaining the interim code for writing completion
After beam row, the method further includes:
Setting terminates label after writing the end line of the code of completion in the stage.
6. method as described in claim 3 or 4, which is characterized in that the starting for obtaining stage and writing the code of completion
Row, including:
The initial row of the code of completion is write using the last one the first row after terminating label as the stage.
7. method as described in claim 3 or 4, which is characterized in that the code between initial row and end line carries out
After compiling, the method further includes:
If compile error alerts.
8. method as described in claim 3 or 4, which is characterized in that the code between initial row and end line carries out
After compiling, the method further includes:
The compile error is stored in the form of text.
9. a kind of code compilation device, which is characterized in that described device includes:
Timer, for being periodically detected the code write;
Determining device, for judging whether stage writes completion to the code write;
Compiler, if writing completion for stage, the code that completion is write to stage is compiled.
10. device as claimed in claim 9, which is characterized in that the compiler is additionally operable to:
Obtain the initial row that the stage writes the code of completion;
Obtain the end line that the stage writes the code of completion;
Code between the initial row and end line is compiled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810168956.0A CN108563442A (en) | 2018-02-28 | 2018-02-28 | Code compiling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810168956.0A CN108563442A (en) | 2018-02-28 | 2018-02-28 | Code compiling method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108563442A true CN108563442A (en) | 2018-09-21 |
Family
ID=63531356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810168956.0A Pending CN108563442A (en) | 2018-02-28 | 2018-02-28 | Code compiling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108563442A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109857406A (en) * | 2019-02-15 | 2019-06-07 | 上海微小卫星工程中心 | Satellite embedded software batch processing system and method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1794175A (en) * | 2006-01-06 | 2006-06-28 | 浙江大学 | Compiler and energy-saving method of operation system kernel coordination |
CN101477467A (en) * | 2008-12-08 | 2009-07-08 | 山东浪潮齐鲁软件产业股份有限公司 | Project code releasing method |
US20120131549A1 (en) * | 2010-11-24 | 2012-05-24 | International Business Machines Corporation | Systems and methods for automatically optimizing high performance computing programming languages |
CN104536797A (en) * | 2015-01-14 | 2015-04-22 | 大唐微电子技术有限公司 | Java program precompiling method and precompiler |
CN107168749A (en) * | 2017-05-31 | 2017-09-15 | 腾讯科技(深圳)有限公司 | A kind of Compilation Method, device, equipment and computer-readable recording medium |
CN107608677A (en) * | 2017-09-05 | 2018-01-19 | 腾讯科技(深圳)有限公司 | A kind of process of compilation method, apparatus and electronic equipment |
-
2018
- 2018-02-28 CN CN201810168956.0A patent/CN108563442A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1794175A (en) * | 2006-01-06 | 2006-06-28 | 浙江大学 | Compiler and energy-saving method of operation system kernel coordination |
CN101477467A (en) * | 2008-12-08 | 2009-07-08 | 山东浪潮齐鲁软件产业股份有限公司 | Project code releasing method |
US20120131549A1 (en) * | 2010-11-24 | 2012-05-24 | International Business Machines Corporation | Systems and methods for automatically optimizing high performance computing programming languages |
CN104536797A (en) * | 2015-01-14 | 2015-04-22 | 大唐微电子技术有限公司 | Java program precompiling method and precompiler |
CN107168749A (en) * | 2017-05-31 | 2017-09-15 | 腾讯科技(深圳)有限公司 | A kind of Compilation Method, device, equipment and computer-readable recording medium |
CN107608677A (en) * | 2017-09-05 | 2018-01-19 | 腾讯科技(深圳)有限公司 | A kind of process of compilation method, apparatus and electronic equipment |
Non-Patent Citations (2)
Title |
---|
上海市计算机应用能力考核办公室: "《Excel 2000应用技术》", 31 December 2002 * |
陈杰华: "《最佳数据库培训教程 可供等级考试二级用》", 31 January 1999 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109857406A (en) * | 2019-02-15 | 2019-06-07 | 上海微小卫星工程中心 | Satellite embedded software batch processing system and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106919434B (en) | Code generation method and device | |
Campbell et al. | Syntax errors just aren't natural: Improving error reporting with language models | |
US8381194B2 (en) | Methods and apparatuses for selective code coverage | |
Cai et al. | An empirical study of long-lived code clones | |
WO2015200235A1 (en) | Techniques for edit-and-continue and enhanced optimized debugging on optimized code | |
US20080028373A1 (en) | Method and apparatus for performing conditional compilation | |
CN110134215B (en) | Data processing method and device, electronic equipment and readable storage medium | |
CN107346284B (en) | Application program detection method and detection device | |
CN102623069B (en) | Random excitation flash model verification method | |
CN103559125B (en) | A kind of method utilizing isomorphism of graph certifying compilation device | |
CN110362310A (en) | A kind of code syntax errors repair method based on incomplete abstract syntax tree | |
CN101976187A (en) | Stack tracing method and device in decompilation process and decompiler | |
CN108920382B (en) | Test case generation method and device, storage medium and server | |
CN102880493B (en) | Method for automatically analyzing dynamic dependency relationship between members | |
CN102402505B (en) | Delta language translation method and system | |
CN103914379A (en) | Automatic fault injection and fault detecting method and system | |
CN100570560C (en) | Start chip software version information method to set up and device | |
CN105511934A (en) | Resource processing method and device in application program development | |
CN108563442A (en) | Code compiling method and device | |
CN102214142A (en) | Instrumentation method for traceless manageable source code manually-defined mark | |
Juričić | Detecting source code similarity using low-level languages | |
Frank et al. | From treebank resources to LFG f-structures: Automatic f-structure annotation of treebank trees and CFGs extracted from treebanks | |
CN102253846A (en) | Method for upgrading embedded system software | |
CN110083493A (en) | A kind of embedded system failure self-recovery method, terminal device and storage medium | |
CN111767035A (en) | Application interface docking method and device based on OpenAPI |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180921 |
|
RJ01 | Rejection of invention patent application after publication |