CN104699467A - Source code processing method and device - Google Patents

Source code processing method and device Download PDF

Info

Publication number
CN104699467A
CN104699467A CN201310646480.4A CN201310646480A CN104699467A CN 104699467 A CN104699467 A CN 104699467A CN 201310646480 A CN201310646480 A CN 201310646480A CN 104699467 A CN104699467 A CN 104699467A
Authority
CN
China
Prior art keywords
reference position
code
source code
jump
end position
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
Application number
CN201310646480.4A
Other languages
Chinese (zh)
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.)
Beijing Feinno Communication Technology Co Ltd
Original Assignee
Beijing Feinno Communication Technology Co Ltd
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 Beijing Feinno Communication Technology Co Ltd filed Critical Beijing Feinno Communication Technology Co Ltd
Priority to CN201310646480.4A priority Critical patent/CN104699467A/en
Publication of CN104699467A publication Critical patent/CN104699467A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a source code processing method and a source code processing device and belongs to the field of software source code text processing. The method comprises the following steps: acquiring an end position of a code of a single-row source code, wherein the single-row source code comprises the code and annotation corresponding to the code; according to preset minimum initial position and hop step length and the end position of the code, determining a target initial position; moving an initial position of the annotation to the target initial position. By determining the target initial position according to the end position of the code, the minimum initial position and the hop step length and moving the initial position of the annotation to the target initial position, the method solves the problem that in a source code processing method in the prior art, only the code in the source doe is formatted, but the annotation in the source code is not processed, and achieves the aim of improving a formatting effect.

Description

Source code disposal route and device
Technical field
The present invention relates to software source codes text-processing field, particularly a kind of source code disposal route and device.
Background technology
In software development, due to the difference of personal habits, the style of the source code that different developers writes is also inconsistent.Therefore, on stream, usually need to format the source code write, to improve readability and the maintainability of source code.
In addition, for the ease of reading and safeguarding, in source code, usually the annotation that the function of code is described also is included.Equally, also there is comments forms effect in existing source code poor, interface is unfriendly, cause the readability of source code and maintainability lower.
Summary of the invention
Only formaing for the code in source code to solve source code disposal route in prior art, for the problem that the annotation in source code is not then processed, embodiments providing a kind of source code disposal route and device.Described technical scheme is as follows:
On the one hand, provide a kind of source code disposal route, described method comprises:
Be handled as follows for row source code each in source code:
Obtain the end position of the code in single file source code, in described single file source code, include described code and the annotation corresponding with described code;
According to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code;
The reference position of described annotation is moved to described target reference position;
Source code after process is applied.
The described end position according to described code, described minimum reference position and described jump step-length determination target reference position, comprising:
When carrying out the 1st time and judging, before judging whether the end position of described code is in described minimum reference position; If judged result is the end position of described code be in described minimum reference position before, then described minimum reference position is defined as described target reference position; If before the end position that judged result is described code is not in described minimum reference position, then carries out the 2nd time and judge;
When carrying out i-th time and judging, obtain the reference position after jumping for the i-th-1 time, the reference position after described the i-th-1 time jump is according to described jump step-length jump i-1 rear position obtained backward from described minimum reference position; Judge the end position of described code whether be in described the i-th-1 time jump after reference position before; If judged result is the end position of described code be in described the i-th-1 time jump after reference position before, then by described the i-th-1 time jump after reference position be defined as described target reference position; If the end position that judged result is described code be not in described the i-th-1 time jump after reference position before, then carry out the i-th+1 time judge, i be more than or equal to 2 integer.
Before the end position determination target reference position of the minimum reference position that described basis pre-sets and jump step-length and described code, described method also comprises:
Display first arranges interface;
Arrange in interface described first and receive the first numerical value n, n be more than or equal to 1 integer;
The n-th character position in described single file source code is set to described minimum reference position.
Before the end position determination target reference position of the minimum reference position that described basis pre-sets and jump step-length and described code, described method also comprises:
Display second arranges interface;
Arrange in interface described second and receive second value m, m be more than or equal to 1 integer;
According to described second value m, described jump step-length is set.
Described described jump step-length is set according to described second value m, comprises:
Described jump step-length is set to m character, or described jump step-length is set to 4m character;
The end position of the code in described acquisition single file source code, before including described code and the annotation corresponding with described code, also comprises in described single file source code:
Format process is carried out to the code in described source code.
On the other hand, provide a kind of source code treating apparatus, described device comprises:
Acquisition module, for obtaining the end position of the code comprised in single file source code, includes described code and the annotation corresponding with described code in described single file source code;
Determination module, for the end position determination target reference position according to the minimum reference position pre-set and jump step-length and described code;
Position mobile module, for moving to described target reference position by the reference position of described annotation;
Application module, for applying the source code after process.
Described determination module, for when carrying out the 1st time and judging, before judging whether the end position of described code is in described minimum reference position; If judged result is the end position of described code be in described minimum reference position before, then described minimum reference position is defined as described target reference position; If before the end position that judged result is described code is not in described minimum reference position, then carries out the 2nd time and judge;
Described determination module, also for when carrying out i-th time and judging, obtains the reference position after jumping for the i-th-1 time, and the reference position after described the i-th-1 time jump is according to described jump step-length jump i-1 rear position obtained backward from described minimum reference position; Judge the end position of described code whether be in described the i-th-1 time jump after reference position before; If judged result is the end position of described code be in described the i-th-1 time jump after reference position before, then by described the i-th-1 time jump after reference position be defined as described target reference position; If the end position that judged result is described code be not in described the i-th-1 time jump after reference position before, then carry out the i-th+1 time judge, i be more than or equal to 2 integer.
Described device also comprises:
First display module, for before described determination module is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display first arranges interface;
First receiver module, receives the first numerical value n for arranging in interface described first, n be more than or equal to 1 integer;
First arranges module, for the n-th character position in described single file source code is set to described minimum reference position.
Described device also comprises:
Second display module, for before described determination module is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display second arranges interface;
Second receiver module, receives second value m for arranging in interface described second, m be more than or equal to 1 integer;
Second arranges module, for arranging described jump step-length according to described second value m.
Described second arranges module, for described jump step-length is set to m character, or described jump step-length is set to 4m character;
Described acquisition module, also for before the end position obtaining the code in single file source code, carries out format process to the code in described source code.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By the end position according to code, minimum reference position and jump step-length determination target reference position, and the reference position of annotation is moved to this target reference position, solve source code disposal route in prior art only to format for the code in source code, for the problem that the annotation in source code is not then processed, reach the object improving format effect.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the method flow diagram of the source code disposal route that one embodiment of the invention provides;
Fig. 2 is the method flow diagram of the source code disposal route that another embodiment of the present invention provides;
Fig. 3 is the source code schematic diagram before treatment that another embodiment of the present invention provides;
Fig. 4 is the source code schematic diagram after the process that provides of another embodiment of the present invention;
Fig. 5 is the structure drawing of device of the source code treating apparatus that one embodiment of the invention provides;
Fig. 6 is the structure drawing of device of the source code treating apparatus that another embodiment of the present invention provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Please refer to Fig. 1, it illustrates the method flow diagram of the source code disposal route that one embodiment of the invention provides.This source code disposal route may be used for carrying out format process to the annotation in source code.This source code disposal route can comprise:
Step 101, obtains the end position of the code in single file source code, includes code and the annotation corresponding with code in this single file source code;
The method of the present embodiment can be performed by SDK (Software Development Kit).
Step 102, according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and code;
In the present embodiment, minimum reference position is the minimum reference position starting to place annotation pre-set.Jump step-length is for from minimum reference position, and the reference position of annotation is jumped or the least unit length of movement backward, and that is, starting of finally determining places the integral multiple that the target reference position that annotates and minimum reference position distance are apart jump step-length.Minimum reference position and numerical value corresponding to jump step-length for being set in advance in default value in SDK (Software Development Kit), also can be arranged by user in advance as required.
Step 103, moves to this target reference position by the reference position of annotation;
After determining target reference position, the reference position of annotation is moved to this target reference position, namely from this target reference position, place annotation.
Step 104, applies the source code after process.
Particularly, carrying out application to the source code after process can for showing the source code after process or runs.
In sum, the source code disposal route that the embodiment of the present invention provides, by the end position according to code, minimum reference position and jump step-length determination target reference position, and the reference position of annotation is moved to this target reference position, solve source code disposal route in prior art only to format for the code in source code, for the problem that the annotation in source code is not then processed, reach the object improving format effect, source code after process improves readability and the maintainability of source code, be convenient to developer safeguard source code, analysis of failure etc., improve the efficiency of source code application.
Please refer to Fig. 2, it illustrates the method flow diagram of the source code disposal route that another embodiment of the present invention provides.This source code disposal route may be used for carrying out format process to the annotation in source code.Be used in SDK (Software Development Kit) for this source code disposal route, this source code disposal route can comprise:
Step 201, the numerical value according to user's input arranges minimum reference position and jump step-length;
SDK (Software Development Kit) can show first and arrange interface, first arranges in interface and receives the first numerical value n, and the n-th character position in this single file source code is set to this minimum reference position at this.SDK (Software Development Kit) can also show second and arrange interface; Second arrange in interface at this and receive second value m; According to this second value m, this jump step-length is set, wherein, n and m be more than or equal to 1 integer.
In actual applications, SDK (Software Development Kit) can arrange interface and second and arrange interface and merge into and samely arrange interface by first, user can arrange in interface at this numerical value inputted for arranging minimum reference position and jump step-length.
Specifically such as, user opens SDK (Software Development Kit), after format parameter setting options in click option card, ejection arranges interface, and this arranges in interface and includes the first numerical value input frame and second value input frame, supposes that user inputs 64 in the first numerical value input frame, and input 16 in second value input frame after, click confirming button, minimum reference position is set to the 64th character position by SDK (Software Development Kit), and jump step-length is set to 16 character lengths.
The second value m that user inputs can be set to the number of characters of jump step-length by SDK (Software Development Kit), in addition, due under normal circumstances, the indentation of code is 4 characters, and namely developer inputs the code in source code, or, when SDK (Software Development Kit) formats the code in source code, according to 4 characters, indentation is carried out to code, therefore, in order to improve the format effect to annotation further, jump step-length also can be set to 4m character by SDK (Software Development Kit).Such as, pre-setting step-length radix in SDK (Software Development Kit) is 4, and meanwhile, second value user inputted is as step-size factor, if the second value of user's input is 4, then jump step-length is set to 16 character lengths by SDK (Software Development Kit).
Step 202, obtains the end position of the code in the minimum reference position and jump step-length and single file source code arranged;
Code and the annotation corresponding with code is included in this single file source code.
User inputs source code or after opening source code text, can select a line or multirow source code in SDK (Software Development Kit), and clicks the button that formats source code, and the annotation in the source code that SDK (Software Development Kit) is selected user formats line by line.Or when user does not select the source code of specifying, SDK (Software Development Kit) acquiescence formats line by line to when the annotation in all source code texts of front opening.
In addition, when SDK (Software Development Kit) formats line by line to the annotation in source code, can first format the code in single file source code, and obtain the end position of the code after format, or, SDK (Software Development Kit) also can not format code, directly obtains the end position of the code in single file source code.
Particularly, in SDK (Software Development Kit), every format parameter can be previously provided with, such as indentation number of characters and operational symbol interval.Developer is when formaing the code in source code, after the sound code file write can being opened in SDK (Software Development Kit), click the formatting options in SDK (Software Development Kit), namely SDK (Software Development Kit) can arrange the code in source code according to the format parameter pre-set, and meets predetermined form to make code.
Annotation in source code meets predetermined form, and be generally " //ABABAB " or "/* ABABAB*/" form, wherein ABABAB represents notes content.SDK (Software Development Kit) can by this predetermined form difference also separating code and annotation.Specifically as shown in Figure 3, wherein, in every a line source code, first half is code, and latter half is annotation, and last character position of the code section in every a line source code is the end position of the code in this single file source code, distance between the end position of code and the reference position of annotation determines when inputting source code by developer, such as, developer can input annotation at once when code end of input, and after also can striking twice space bar, input annotates.
Step 203, according to the end position determination target reference position of minimum reference position and jump step-length and code;
Wherein, SDK (Software Development Kit) can determine target reference position by the mode successively judged.Concrete, when carrying out the 1st determining step, before SDK (Software Development Kit) judges whether the end position of this code is in this minimum reference position; If judged result is the end position of this code be in this minimum reference position before, then this minimum reference position is defined as this target reference position, determining step terminates; If before the end position that judged result is this code is not in this minimum reference position, then enter the 2nd determining step.
When carrying out i-th determining step, SDK (Software Development Kit) obtains the reference position after jumping for the i-th-1 time, and the reference position after jumping for this i-th-1 time is according to this jump step-length jump i-1 rear position obtained backward from this minimum reference position; Before judging whether the end position of this code is in the reference position after jumping for this i-th-1 time; If judged result is the end position of this code be in this i-th-1 time jump after reference position before, then by this i-th-1 time jump after reference position be defined as this target reference position, determining step terminates; If the end position that judged result is this code be not in this i-th-1 time jump after reference position before, then enter the i-th+1 time determining step, until determine target reference position, wherein, i be more than or equal to 2 integer.
Concrete, with this preset minimum reference position be the 64th character position, the jump step-length preset is 16 character lengths is example, first the end position of the code got and minimum reference position compare by SDK (Software Development Kit), before judging whether the end position of code is in minimum reference position, if, then minimum reference position is defined as target reference position, determining step terminates, otherwise, further judge whether the end position of code is in the 80th character position before, if, then the 80th character position is defined as target reference position, otherwise, further judge whether the end position of code is in the 96th character position before, the rest may be inferred, till determining target reference position.
In the present embodiment, minimum reference position is the default position starting to place annotation, reference position after jumping for the i-th-1 time is from this minimum reference position according to this jump step-length jump i-1 rear interim position starting to place annotation obtained backward, and target reference position is the position starting placement annotation finally determined.
Step 204, moves to this target reference position by the reference position of annotation.
SDK (Software Development Kit) reapposes annotation from this target reference position.
SDK (Software Development Kit) is after formaing the annotation in single file source code, proceed to next line source code, obtain the end position of the code in next line source code, and after determining the target reference position of next line source code, the reference position of the annotation of next line source code is moved to this target reference position, proceed to lower next line source code subsequently, until the source code selected of user or the source code full formatization of current display complete.Such as, for the source code shown in Fig. 3, the source code after comments forms is carried out as shown in Figure 4.As can be seen from result above, the format of source code annotation does not need all left-justifys of all annotations, but aligns according to code length, and this processing mode every provisional capital independent processing, ensure that the stability of alignment, not by the impact of other row source code.
Step 205: the source code after process is applied.
In the present embodiment, the source code after process is applied and comprise the source code after to process and show, run, analyze or maintenance etc.
In sum, the source code disposal route that the embodiment of the present invention provides, by the end position according to code, minimum reference position and jump step-length determination target reference position, and the reference position of annotation is moved to this target reference position, solve source code disposal route in prior art only to format for the code in source code, for the problem that the annotation in source code is not then processed, reach the object improving format effect, source code after process improves readability and the maintainability of source code, be convenient to developer safeguard source code, analysis of failure etc., improve the efficiency of source code application, secondly, the source code disposal route that the embodiment of the present invention provides, arranges minimum reference position and jump step-length according to user arranging the numerical value inputted in interface, reaches and improve the dirigibility of comments forms and the object of customizability, finally, the source code disposal route that the embodiment of the present invention provides, is set to the integral multiple of 4 by jump step-length, corresponding with the indentation number of characters of code, reaches the object improving format effect further.
Please refer to Fig. 5, it illustrates the structure drawing of device of the source code treating apparatus that one embodiment of the invention provides.This source code treating apparatus may be used for performing the source code disposal route as shown in above-mentioned Fig. 1 or Fig. 2.This source code treating apparatus is a part for SDK (Software Development Kit) or SDK (Software Development Kit).This source code checker-work can comprise:
Acquisition module 301, for obtaining the end position of the code in single file source code, includes described code and the annotation corresponding with described code in described single file source code;
Determination module 302, the minimum reference position pre-set for basis and the end position of jump step-length and described code, described minimum reference position and described jump step-length determination target reference position;
Position mobile module 303, for moving to described target reference position by the reference position of described annotation;
Application module 304, for applying the source code after process.
In sum, the source code treating apparatus that the embodiment of the present invention provides, by the end position according to code, minimum reference position and jump step-length determination target reference position, and the reference position of annotation is moved to this target reference position, solve source code disposal route in prior art only to format for the code in source code, for the problem that the annotation in source code is not then processed, reach the object improving format effect, source code after process improves readability and the maintainability of source code, be convenient to developer safeguard source code, analyze, improve the efficiency of source code application.
Please refer to Fig. 6, it illustrates the structure drawing of device of the source code treating apparatus that another embodiment of the present invention provides.This source code treating apparatus may be used for performing the source code disposal route as shown in above-mentioned Fig. 1 or Fig. 2.This source code treating apparatus is a part for SDK (Software Development Kit) or SDK (Software Development Kit).This source code checker-work can comprise:
Acquisition module 401, for obtaining the end position of the code in single file source code, includes described code and the annotation corresponding with described code in described single file source code;
Determination module 402, for the end position determination target reference position according to the minimum reference position pre-set and jump step-length and described code;
Position mobile module 403, for moving to described target reference position by the reference position of described annotation;
Application module 404, for applying the source code after process.
Described determination module 402, for when carrying out the 1st time and judging, before judging whether the end position of described code is in described minimum reference position; If judged result is the end position of described code be in described minimum reference position before, then described minimum reference position is defined as described target reference position; If before the end position that judged result is described code is not in described minimum reference position, then carries out the 2nd time and judge;
Described determination module 402, also for when carrying out i-th time and judging, obtains the reference position after jumping for the i-th-1 time, and the reference position after described the i-th-1 time jump is according to described jump step-length jump i-1 rear position obtained backward from described minimum reference position; Judge the end position of described code whether be in described the i-th-1 time jump after reference position before; If judged result is the end position of described code be in described the i-th-1 time jump after reference position before, then by described the i-th-1 time jump after reference position be defined as described target reference position; If the end position that judged result is described code be not in described the i-th-1 time jump after reference position before, then carry out the i-th+1 time judge, i be more than or equal to 2 integer.
Described device also comprises:
First display module 405, for before described determination module 402 is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display first arranges interface;
First receiver module 406, receives the first numerical value n for arranging in interface described first, n be more than or equal to 1 integer;
First arranges module 407, for the n-th character position in described single file source code is set to described minimum reference position.
Described device also comprises:
Second display module 408, for before described determination module 402 is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display second arranges interface;
Second receiver module 409, receives second value m for arranging in interface described second, m be more than or equal to 1 integer;
Second arranges module 410, for arranging described jump step-length according to described second value m.
Described second arranges module 410, for described jump step-length is set to m character, or described jump step-length is set to 4m character;
Described acquisition module 401, also for before the end position obtaining the code in single file source code, carries out format process to the code in described source code.
In sum, the source code treating apparatus that the embodiment of the present invention provides, by the end position according to code, minimum reference position and jump step-length determination target reference position, and the reference position of annotation is moved to this target reference position, solve in prior art and only format for the code in source code, for the problem that the annotation in source code is not then processed, reach the object improving format effect; Secondly, the source code treating apparatus that the embodiment of the present invention provides, arranges minimum reference position and jump step-length according to user arranging the numerical value inputted in interface, reaches and improve the dirigibility of comments forms and the object of customizability; Finally, the source code treating apparatus that the embodiment of the present invention provides, is set to the integral multiple of 4 by jump step-length, corresponding with the indentation number of characters of code, reaches the object improving format effect further.
It should be noted that: the source code treating apparatus that above-described embodiment provides is when formaing annotation, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.In addition, the source code treating apparatus that above-described embodiment provides and source code disposal route embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a source code disposal route, is characterized in that, described method comprises:
Be handled as follows for row source code each in source code:
Obtain the end position of the code in single file source code, in described single file source code, include described code and the annotation corresponding with described code;
According to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code;
The reference position of described annotation is moved to described target reference position;
Source code after process is applied.
2. method according to claim 1, is characterized in that, the end position determination target reference position of the minimum reference position that described basis pre-sets and jump step-length and described code, comprising:
When carrying out the 1st time and judging, before judging whether the end position of described code is in described minimum reference position; If judged result is the end position of described code be in described minimum reference position before, then described minimum reference position is defined as described target reference position; If before the end position that judged result is described code is not in described minimum reference position, then carries out the 2nd time and judge;
When carrying out i-th time and judging, obtain the reference position after jumping for the i-th-1 time, the reference position after described the i-th-1 time jump is according to described jump step-length jump i-1 rear position obtained backward from described minimum reference position; Judge the end position of described code whether be in described the i-th-1 time jump after reference position before; If judged result is the end position of described code be in described the i-th-1 time jump after reference position before, then by described the i-th-1 time jump after reference position be defined as described target reference position; If the end position that judged result is described code be not in described the i-th-1 time jump after reference position before, then carry out the i-th+1 time judge, i be more than or equal to 2 integer.
3. method according to claim 1, is characterized in that, before the end position determination target reference position of the minimum reference position that described basis pre-sets and jump step-length and described code, described method also comprises:
Display first arranges interface;
Arrange in interface described first and receive the first numerical value n, n be more than or equal to 1 integer;
The n-th character position in described single file source code is set to described minimum reference position.
4. the method according to any one of claim 1-3, is characterized in that, before the end position determination target reference position of the minimum reference position that described basis pre-sets and jump step-length and described code, described method also comprises:
Display second arranges interface;
Arrange in interface described second and receive second value m, m be more than or equal to 1 integer;
According to described second value m, described jump step-length is set.
5. method according to claim 4, is characterized in that, describedly arranges described jump step-length according to described second value m, comprising:
Described jump step-length is set to m character, or described jump step-length is set to 4m character;
The end position of the code in described acquisition single file source code, before including described code and the annotation corresponding with described code, also comprises in described single file source code:
Format process is carried out to the code in described source code.
6. a source code treating apparatus, is characterized in that, described device comprises:
Acquisition module, for obtaining the end position of the code in single file source code, includes described code and the annotation corresponding with described code in described single file source code;
Determination module, for the end position determination target reference position according to the minimum reference position pre-set and jump step-length and described code;
Position mobile module, for moving to described target reference position by the reference position of described annotation;
Application module, for applying the source code after process.
7. device according to claim 6, is characterized in that,
Described determination module, for when carrying out the 1st time and judging, before judging whether the end position of described code is in described minimum reference position; If judged result is the end position of described code be in described minimum reference position before, then described minimum reference position is defined as described target reference position; If before the end position that judged result is described code is not in described minimum reference position, then carries out the 2nd time and judge;
Described determination module, also for when carrying out i-th time and judging, obtains the reference position after jumping for the i-th-1 time, and the reference position after described the i-th-1 time jump is according to described jump step-length jump i-1 rear position obtained backward from described minimum reference position; Judge the end position of described code whether be in described the i-th-1 time jump after reference position before; If judged result is the end position of described code be in described the i-th-1 time jump after reference position before, then by described the i-th-1 time jump after reference position be defined as described target reference position; If the end position that judged result is described code be not in described the i-th-1 time jump after reference position before, then carry out the i-th+1 time judge, i be more than or equal to 2 integer.
8. device according to claim 6, is characterized in that, described device also comprises:
First display module, for before described determination module is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display first arranges interface;
First receiver module, receives the first numerical value n for arranging in interface described first, n be more than or equal to 1 integer;
First arranges module, for the n-th character position in described single file source code is set to described minimum reference position.
9. the device according to any one of claim 6-8, is characterized in that, described device also comprises:
Second display module, for before described determination module is according to the end position determination target reference position of the minimum reference position pre-set and jump step-length and described code, display second arranges interface;
Second receiver module, receives second value m for arranging in interface described second, m be more than or equal to 1 integer;
Second arranges module, for arranging described jump step-length according to described second value m.
10. device according to claim 9, is characterized in that, described second arranges module, for described jump step-length is set to m character, or described jump step-length is set to 4m character;
Described acquisition module, also for before the end position obtaining the code in single file source code, carries out format process to the code in described source code.
CN201310646480.4A 2013-12-04 2013-12-04 Source code processing method and device Pending CN104699467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310646480.4A CN104699467A (en) 2013-12-04 2013-12-04 Source code processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310646480.4A CN104699467A (en) 2013-12-04 2013-12-04 Source code processing method and device

Publications (1)

Publication Number Publication Date
CN104699467A true CN104699467A (en) 2015-06-10

Family

ID=53346638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310646480.4A Pending CN104699467A (en) 2013-12-04 2013-12-04 Source code processing method and device

Country Status (1)

Country Link
CN (1) CN104699467A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226461A (en) * 2007-01-16 2008-07-23 京瓷美达株式会社 Data processing method for printing
CN102339218A (en) * 2010-07-21 2012-02-01 阳振庭 Program code annotating management method and device
US20120192058A1 (en) * 2009-11-12 2012-07-26 International Business Machines Corporation Method for internationalization technology
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226461A (en) * 2007-01-16 2008-07-23 京瓷美达株式会社 Data processing method for printing
US20120192058A1 (en) * 2009-11-12 2012-07-26 International Business Machines Corporation Method for internationalization technology
CN102339218A (en) * 2010-07-21 2012-02-01 阳振庭 Program code annotating management method and device
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
唐友: "《Java语言程序设计》", 31 January 2013 *
好好学习,天天进步: "代码注释对齐", 《HTTP://WWW.CNBLOGS.COM/MARRYZHAN/ARCHIVE/2011/09/22/2213901.HTML》 *

Similar Documents

Publication Publication Date Title
AU2014268843B9 (en) Ink to text representation conversion
CN103077715B (en) Merge voice recognition result
US9244658B2 (en) Multi-step auto-completion model for software development environments
JP6192104B2 (en) Text editing apparatus and program
US20140164900A1 (en) Appending content with annotation
US10528670B2 (en) Amendment source-positioning method and apparatus, computer device and readable medium
CN107943770A (en) Web page form speed input method and device based on spare and accessory parts transaction platform
CN110555073A (en) data processing method and device, electronic equipment and storage medium
CN103019398A (en) Character input method and character input device
CN104932774B (en) A kind of information processing method and electronic equipment
CN102323858B (en) Identify the input method of modification item in input, terminal and system
CN107203510A (en) character detecting method and device
CN104699467A (en) Source code processing method and device
KR20170132643A (en) Method for displaying character and Apparatus thereof
KR101275040B1 (en) Free form line recognition based electronic document driving apparatus and method
CN107291350A (en) Method for deleting and terminal device applied to the terminal device for supporting multi-point touch
CN113705178A (en) Document processing method, document processing device, electronic equipment and medium
CN108628528A (en) The mthods, systems and devices of the cross-page text mark of application are read in optimization
CN105740222A (en) Method and device used for reader typesetting, reader and electronic device
CN105630959B (en) Text information display method and electronic equipment
CN106407247B (en) Data query method and device
US20140059411A1 (en) Novel computing system
KR20140088945A (en) Method and system of restoring characters deleted by backspace key
CN104966513B (en) Verbal order treating method and apparatus
KR102160249B1 (en) A method for editing a plurality of memo pages stored in portable device and an apparatus therefor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150610