CN109683881A - A kind of code format method of adjustment and device - Google Patents

A kind of code format method of adjustment and device Download PDF

Info

Publication number
CN109683881A
CN109683881A CN201811618411.1A CN201811618411A CN109683881A CN 109683881 A CN109683881 A CN 109683881A CN 201811618411 A CN201811618411 A CN 201811618411A CN 109683881 A CN109683881 A CN 109683881A
Authority
CN
China
Prior art keywords
code
character
feature
type
adjustment
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.)
Granted
Application number
CN201811618411.1A
Other languages
Chinese (zh)
Other versions
CN109683881B (en
Inventor
刘硕
史家涛
宋炳雨
许晓梦
张国花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weichai Power Co Ltd
Original Assignee
Weichai Power 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 Weichai Power Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN201811618411.1A priority Critical patent/CN109683881B/en
Publication of CN109683881A publication Critical patent/CN109683881A/en
Application granted granted Critical
Publication of CN109683881B publication Critical patent/CN109683881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The present invention provides a kind of code format method of adjustment and device, after acquisition needs to carry out the code to be processed of code format adjustment, Format adjusting is carried out to code to be processed based on pre-set code feature, obtain the object code with preset format, export the object code with preset format, so that the preset format between the object code that different codes to be processed obtains after pre-set code Character adjustment is identical, so that the format of different codes to be processed is from diversification to uniform transition, realize the uniform format of different codes to be processed, and unified format can allow each programmer to be capable of the thinking and purpose of accurate understanding code, the readability of code is improved significantly, conducive to the modification and maintenance of code, in addition code to be processed can carry out Format adjusting based on pre-set code feature automatically, save programmer's adjustment or setting The link of format saves artificial adjustment time, improves regulated efficiency.

Description

A kind of code format method of adjustment and device
Technical field
The invention belongs to software code fields, are specially related to a kind of code format method of adjustment and device.
Background technique
With the progress of science and technology, it is continuous to be directed to software project for computer industry also quickly development Expansion, and the software project of some large sizes generally requires more people team and goes to research and develop, such as: software code needs more people to go to cooperate Research and development cause full text code to seem unsightly since everyone is different for the compiling form to code.
The mode that the code with different-format is adjusted to the code with unified format is had at present: pre-establishing code It format specification and is assisted using code editor, but distinct program person is different for pre-establishing code format specification Understanding similarly using code so that also can be different based on the format of the code that code format specification obtains is pre-established Distinct program person is different to the setting of menu relevant to format in code editor when editing machine, also results in and is compiled by code The format for collecting the code that device provides is different.
Summary of the invention
In view of this, being used for will be to be processed the purpose of the present invention is to provide a kind of code format method of adjustment and device Code is based on pre-set code feature and carries out Format adjusting automatically.Technical solution is as follows:
The present invention provides a kind of code format method of adjustment, which comprises
Obtain the code to be processed for needing to carry out code format adjustment;
Format adjusting is carried out to the code to be processed based on pre-set code feature, obtains the target generation with preset format Code;
The output object code with preset format, wherein different codes to be processed is special by the pre-set code Requisition it is whole after preset format between obtained object code it is identical.
Preferably, described that Format adjusting is carried out to the code to be processed based on pre-set code feature, it obtains having default The object code of format includes:
The feature with the code matches to be processed is extracted from the pre-set code feature;
Based on the feature with the code matches to be processed, Format adjusting is carried out to the code to be processed, is had The object code of preset format.
Preferably, described extract from the pre-set code feature includes: with the feature of the code matches to be processed
Determine each independent corresponding type of component part in the code to be processed, each independent composition portion Any independent component part is character string or character in point;
Based on each independent corresponding type of component part, extracted from the pre-set code feature with it is described The corresponding type of type adjusts feature;
It is chosen from the pre-set code feature and shares adjustment feature, the shared adjustment feature is used for described to be processed Part in code in addition to the independent component part carries out format restriction.
Preferably, each independent corresponding type of component part includes: in the determination code to be processed
The character group that every line character includes in the code to be processed is obtained, wherein the character group that any one line character includes Have: last character and n-th in the character group, the line character in the line character between first character and the 1st space Character group, i-th of space between space and the character group between i+1 space, wherein the value of i is 2 to n-1, and n is institute State the space sum for including in code to be processed;
Following steps are executed to any character group:
If the full content that the character group carries is one of number, operator, punctuation mark and default reserved word, Then the type of the character group is the corresponding type of full content, if character quantity determines the character group greater than 1 in the character group Determine that the character group is a character if character quantity is equal to 1 in the character group for a character string;
If the full content that the character group carries does not include number, operator, punctuation mark and default reserved word, it is somebody's turn to do The type of character group is argument types, if character quantity is greater than 1 in the character group, determines that the character group is a character String determines that the character group is a character if character quantity is equal to 1 in the character group;
If character quantity passes through the preset characters greater than 1 and including at least one preset characters in the character group The character group is split, preset characters are determined as to the type phase of a character and the type and preset characters of the character Together, the preset characters include at least one of operator, punctuation mark and number;
To any portion in each section split by the preset characters: if character quantity is equal in the part 1, it is determined that the part is that the type of a character and character is argument types, if character quantity is greater than 1 in the part, Determine that the part is a character string, if the character string is identical as one in default reserved word, it is determined that the character string Type is reserved word type, otherwise determines that the type of the character string is argument types.
Preferably, the acquisition process of the pre-set code feature includes:
It obtains for obtaining the template code of the pre-set code feature;
Determine every kind of independent corresponding all types adjustment feature of component part in the template code;
Feature is adjusted to the corresponding all types of independent component part any in every kind of independent component part: if this kind The corresponding seed type adjustment feature of independent component part all types corresponding with this kind of independent component part adjust feature it Between relationship meet the first preset relation, then by meet the first preset relation type adjustment feature be determined as a kind of pre-set code Feature;
It determines and is suitable for all kinds of shared adjustment features that every line code shares in the template code;
Adjustment feature is shared to any sort in all kinds of shared adjustment features: if one in such share adjustment feature with Relationship between such all shared adjustment feature meets the second preset relation, then will meet the shared adjustment of the second preset relation Feature is determined as a kind of pre-set code feature.
The present invention also provides a kind of code formats to adjust device, and described device includes:
Module is obtained, needs to carry out the code to be processed of code format adjustment for obtaining;
Module is adjusted, for carrying out Format adjusting to the code to be processed based on pre-set code feature, obtains having pre- If the object code of format;
Output module, for exporting the object code with preset format, wherein different codes to be processed passes through The preset format between object code obtained after the pre-set code Character adjustment is identical.
Preferably, the adjustment module includes:
Extraction unit, for extracting the feature with the code matches to be processed from the pre-set code feature;
Adjustment unit, for carrying out format to the code to be processed based on the feature with the code matches to be processed Adjustment, obtains the object code with preset format.
Preferably, the extraction unit includes:
Subelement is determined, for determining each independent corresponding type of component part, institute in the code to be processed Stating any independent component part in each independent component part is character string or character;
Type adjusts feature extraction subelement, for being based on each independent corresponding type of component part, from Type corresponding with the type is extracted in the pre-set code feature adjusts feature;
Adjustment Feature Selection subelement is shared, shares adjustment feature for choosing from the pre-set code feature, it is described Adjustment feature is shared to be used to carry out format restriction to the part in the code to be processed in addition to the independent component part.
Preferably, the determining subelement, specifically for obtaining the character that every line character includes in the code to be processed Group, wherein the character group that any one line character includes has: the character in the line character between first character and the 1st space Character group, i-th of space in group, the line character between last character and n-th of space and between i+1 space Character group, wherein the value of i is 2 to n-1, and n is the space sum for including in the code to be processed;
Following steps are executed to any character group:
If the full content that the character group carries is one of number, operator, punctuation mark and default reserved word, Then the type of the character group is the corresponding type of full content, if character quantity determines the character group greater than 1 in the character group Determine that the character group is a character if character quantity is equal to 1 in the character group for a character string;
If the full content that the character group carries does not include number, operator, punctuation mark and default reserved word, it is somebody's turn to do The type of character group is argument types, if character quantity is greater than 1 in the character group, determines that the character group is a character String determines that the character group is a character if character quantity is equal to 1 in the character group;
If character quantity passes through the preset characters greater than 1 and including at least one preset characters in the character group The character group is split, preset characters are determined as to the type phase of a character and the type and preset characters of the character Together, the preset characters include at least one of operator, punctuation mark and number;
To any portion in each section split by the preset characters: if character quantity is equal in the part 1, it is determined that the part is that the type of a character and character is argument types, if character quantity is greater than 1 in the part, Determine that the part is a character string, if the character string is identical as one in default reserved word, it is determined that the character string Type is reserved word type, otherwise determines that the type of the character string is argument types.
Preferably, described device further include:
Template code obtains module, for obtaining the template code for obtaining the pre-set code feature;
Type adjusts characteristic determination module, and for determining, every kind of independent component part is corresponding in the template code All types adjust feature, adjust to the corresponding all types of independent component part any in every kind of independent component part special Sign: if the corresponding seed type adjustment feature of this kind of independent component part all types corresponding with this kind of independent component part The relationship adjusted between feature meets the first preset relation, then the type adjustment feature for meeting the first preset relation is determined as one Kind pre-set code feature;
Share adjustment characteristic determination module, for determine in the template code be suitable for every line code share it is all kinds of total With adjustment feature, adjustment feature is shared to any sort in all kinds of shared adjustment features: if a shared adjustment in such is special Relationship between sign and such all shared adjustment feature meets the second preset relation, then will meet sharing for the second preset relation Adjustment feature is determined as a kind of pre-set code feature.
Compared with prior art, above-mentioned technical proposal provided by the invention has the advantages that
After acquisition needs to carry out the code to be processed of code format adjustment, based on pre-set code feature to code to be processed Format adjusting is carried out, the object code with preset format is obtained, the object code with preset format is exported, so that different The preset format between object code that code to be processed obtains after pre-set code Character adjustment is identical, so that different The format of code to be processed realizes the uniform format of different codes to be processed from diversification to uniform transition, and unify Format can allow each programmer to be capable of the thinking and purpose of accurate understanding code, improve the readability of code significantly, and Code can accurately be changed on the basis of accurate understanding thinking and purpose, to be conducive to the modification and dimension of code Shield, in addition code to be processed can carry out Format adjusting based on pre-set code feature automatically, save programmer's adjustment or setting lattice The link of formula saves artificial adjustment time, improves regulated efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart of code format method of adjustment provided in an embodiment of the present invention;
Fig. 2 is a kind of feature extracted from pre-set code feature with code matches to be processed provided in an embodiment of the present invention Flow chart;
Fig. 3 is the schematic diagram of one section of code to be processed provided in an embodiment of the present invention;
Fig. 4 is a kind of flow chart for obtaining pre-set code feature provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram of template code provided in an embodiment of the present invention;
It is obtained after pre-set code Character adjustment in Fig. 6 template code shown in Fig. 5 that is code to be processed shown in Fig. 3 The schematic diagram of object code;
Fig. 7 is a kind of structural schematic diagram of code format adjustment device provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of another code format adjustment device provided in an embodiment of the present invention.
Specific embodiment
The present invention provides a kind of code format method of adjustment and device, code to be processed can be based on pre-set code feature It is automatic to carry out Format adjusting, the link of programmer's adjustment or setting format is saved, artificial adjustment time is saved, improves adjustment Efficiency.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
As shown in Figure 1, being a kind of flow chart of code format method of adjustment provided in an embodiment of the present invention, this method includes Following steps:
S101: the code to be processed for needing to carry out code format adjustment is obtained.Wherein code to be processed is to carry out to it The program code of code format adjustment, programmer write one section of program code by terminal, such as computer, mobile phone, when terminal is examined Measure program code and write completion, it is meant that terminal obtains code to be processed, and terminal detection program code write completion can be with It is to detect that programmer's triggering is write to complete control, saves control as programmer clicks, then illustrates that completing primary or part writes.
S102: Format adjusting is carried out to code to be processed based on pre-set code feature, obtains the target with preset format Code.
In the present embodiment, pre-set code be characterized in when code to be processed carries out Format adjusting based on adjustment standard, with So that object code has the preset format of pre-set code feature instruction, that is to say, that pre-set code feature, which can characterize, treats place Which aspect for managing code is defined, and such as the relationship between every row, each characters/words symbol group, header file and character is limited It is fixed, the format that can provide out the object code of final output is defined from there through pre-set code feature, therefore at this Preset format is able to indicate that by pre-set code feature in embodiment.
Wherein pre-set code feature can be artificial defined feature, write code by artificial defined characteristic present When need the normalized written that follows, such as: programmer writes the code skeleton for needing other programmers to follow, the code skeleton The requirement of the relationship between every row, each characters/words symbol group, header file and character is defined, then these requirements can be considered as Pre-set code feature, the unified format that can make object code that there is programmer to want in this way are based on this mode For only need the content by code to be processed to replace the content in code skeleton when writing code to be processed, to obtain The object code of preset format with code skeleton instruction.
Another feasible mode is: choosing a template code, from multiple codes to be processed with from template code In get pre-set code feature, then again be based on pre-set code Character adjustment.Such as: in template code every row only one Program statement, and empty two spaces before each sentence, using these as pre-set code feature.After getting code to be processed In conjunction with these Character adjustments at the object code of the preset format indicated with these features, so that every row of object code Only one program statement, and empty two spaces before each sentence.
But for some code to be processed, all features in pre-set code feature can not be all applicable in should be to Code is handled, then needs to extract the feature with code matches to be processed from pre-set code feature at this time, be based on and generation to be processed The matched feature of code carries out Format adjusting to code to be processed.
Wherein refer to from extraction in pre-set code feature and the feature of code matches to be processed: being selected from pre-set code feature Be suitable for the feature of code to be processed out, such as: pre-set code feature may include: requirement to every line code, every class character/ The requirement of character string, the requirement of header file, every line code level be retracted how many a spaces, every row terminate use punctuation mark Deng extracting applicable feature from pre-set code feature and carry out format tune when needing to carry out Format adjusting for code to be processed It is whole, as having lines of code in code to be processed, then need to extract the feature of every row requirement, the every row of code to be processed is retracted Also to extract the feature of retraction, citing is illustrated below: such as one of pre-set code feature is characterized in a level contracting Into 4 spaces, and one level of code to be processed is retracted 2 spaces, can extract a level at this time and be retracted 4 spaces For feature as the feature with code matches to be processed, a level being then based in pre-set code feature is retracted 4 spaces Feature is retracted 2 spaces to one level of code to be processed and is adjusted to 4 spaces of a level retraction.
S103: exporting the object code with preset format, wherein different codes to be processed passes through pre-set code feature The preset format between object code obtained after adjustment is identical.That is although the format of different codes to be processed has not Together, but after pre-set code feature carries out Format adjusting, the format of the object code of output is preset format, so that mesh Format between mark code is the same, in this way for being to unify the need of format by the format conversion of different codes to be processed For asking, it is only necessary to which pre-set code feature, which is arranged, can be realized, compared to artificial adjustment Format adjusting not only accurate and efficiency but also high.
Wherein preset format can be for for a project or a company, so that a project or a company give Object code out all has unified preset format, and disparity items or different company can use different preset formats, Have except unified preset format in the code for guaranteeing a unit (such as a project or a company) in this way, and can protect Format diversification is demonstrate,proved, as the code format of disparity items can be different.
Herein it should be noted is that: although code to be processed by code format adjust, code to be processed It still can be used as source code reservation, in order to which source code and object code are compared programmer, understand which aspect is adjusted Whole, such programmer can correct the editor Format of itself based on aspect is adjusted, so that the program generation of subsequent development Code symbol closes the requirement of the preset format of pre-set code feature instruction.
According to the above-mentioned technical solution, after acquisition needs to carry out the code to be processed of code format adjustment, based on pre- If code characteristic carries out Format adjusting to code to be processed, the object code with preset format is obtained, output has default lattice The object code of formula, so that pre- between the object code that different codes to be processed obtains after pre-set code Character adjustment If format is identical, so that the format of different codes to be processed is realized different to be processed from diversification to uniform transition The uniform format of code, and unified format can allow each programmer to be capable of the thinking and purpose of accurate understanding code, significantly Ground improves the readability of code, and can accurately be changed to code on the basis of accurate understanding thinking and purpose, To be conducive to the modification and maintenance of code, in addition code to be processed can carry out Format adjusting based on pre-set code feature automatically, The link for saving programmer's adjustment or setting format, saves artificial adjustment time, improves regulated efficiency.
As shown in Fig. 2, being extracted and code to be processed from pre-set code feature for one kind provided in an embodiment of the present invention Flow chart with feature, method includes the following steps:
S201: each independent corresponding type of component part, each independent component part in code to be processed are determined In any independent component part be character string or character.That is for code to be processed, the code to be processed be by The independent component part of character string and character both types composition, it should be noted that character is exactly single character, and character String is the set of multiple characters, and code to be processed as shown in Figure 3, " void ", " main ", " int " are in the code to be processed Character string, and the type of these three character strings is reserved word type, " (", ") " in the code to be processed, " ", " a ", "=", "3","x","5","b","4",";", " c ", "+", " " be character, and " (", ") ", " ", ";" and " " type be mark The type of point symbol type, "=" and "+" is operator type, and the type of " a ", " x ", " b " and " c " is argument types, and The type of " 3 ", " 5 " and " 4 " is numeric type.
S202: being based on each independent corresponding type of component part, extracts and type pair from pre-set code feature The type adjustment feature answered.
Wherein the type of independent component part is at least in code to be processed: reserved word, independent variable, operator, punctuate symbol Number and this digital five seed type have this corresponding class of five seed types in pre-set code feature for this five seed type Type adjusts feature, therefore after obtaining a code to be processed, needs to determine that the code to be processed contains several types first Independent component part, the type adjustment for then extracting the type that the code to be processed contains from pre-set code feature again is special Sign.
Type adjustment feature is used to limit the normalized written that the independent component part of this type is followed in write-in, such as should Whether the independent component part of seed type needs independent component part and phase using upper case character or lowercase character, this type Whether interval etc. is had between adjacent independent component part, such as in code to be processed shown in Fig. 3, from pre-set code feature The type adjustment feature extracted has: left brace individually accounts for a line, right brace individually accounts for a line, the alignment of a pair of of brace and There is space between numerical character and operational character, have space between two neighboring character string, these are all to certain seed type Character or the rule that uses when being adjusted of character string.The type for needing to extract in conjunction with Fig. 5 adjusts feature are as follows: a level contracting Into 4 spaces, left brace individually account for a line, right brace individually accounts for a line, the alignment of a pair of of brace, a line only one language Sentence.
S203: choosing from pre-set code feature and share adjustment feature, shares adjustment feature and is used for in code to be processed Part in addition to independent component part carries out format restriction.
That is pre-set code feature is made of type adjustment feature and shared adjustment feature, and is shared adjustment and be characterized in Suitable for code to be handled feature, such as each code to be processed has lines of code, or even further includes header file, these As the shared part of multiple codes to be processed, the format of these contents is limited then sharing adjustment feature and then can be Fixed, such as share adjustment and be characterized in: the requirement of requirement, header file to every line code, the level retraction of specific every line code are more Few space, every row terminate punctuation mark used etc..Such as have 3 rows between header file and next sentence in vain, every line code 4 spaces are retracted, remove last line in one section of code is terminated with fullstop, remaining is terminated with branch, every row only has a program Sentence etc..
According to the above-mentioned technical solution, it needs when carrying out Format adjusting to code to be processed based on code to be processed Independent component part selects the type adjustment feature of the independent component part suitable for the code to be processed, based on applicable Code to be processed is adjusted in the type adjustment feature of the independent component part of the code to be processed and shared adjustment feature, So that code only needs the type adjustment feature based on shared adjustment feature and needed for itself to be adjusted when adjusting.
In the present embodiment, code to be processed is split to obtain each corresponding type of independent component part Process is as follows:
In the code compilation process of code to be processed, every line character of code to be processed is inputted one by one, obtains every row The character group that character includes, wherein the character group that any one line character includes has: first character and the 1st sky in the line character Character group, i-th of space and i+1 in character group, the line character between lattice between last character and n-th of space Character group between a space, the value of i are 2 to n-1, and n is the space sum for including in code to be processed, to any character Group: determine that the character that the character group includes is character string or character based on the first preset matching rule, and default based on second Matching rule obtains type.
Wherein, the first preset matching rule can be but not limited to the quantity for the character that character group includes, if character group Including character quantity be equal to 1, it is determined that the character group be character, if the quantity for the character that character group includes be greater than 1, Determine that the character group is character string, the second preset matching rule can be based on default reserved word, operator, punctuation mark sum number Word is matched, and for any one programming language, there is defined reserved word (i.e. above-mentioned default reserved word), operation Symbol, punctuation mark, it is possible thereby to type is determined based on these, and number is used for assignment generally in programming language, therefore Type can be determined based on number.Process is as follows: following steps are executed to any character group:
If the full content that the character group carries is one of number, operator, punctuation mark and default reserved word, Then the type of the character group is the corresponding type of full content, if character quantity determines the character group greater than 1 in the character group Determine that the character group is a character if character quantity is equal to 1 in the character group for a character string.
If the full content that the character group carries does not include number, operator, punctuation mark and default reserved word, it is somebody's turn to do The type of character group is argument types, if character quantity is greater than 1 in the character group, determines that the character group is a character String determines that the character group is a character if character quantity is equal to 1 in the character group.
If the number of characters in the character group is greater than 1 and including at least one preset characters, by preset characters to this Character group is split, and preset characters are determined as a character and the type of the character and the type of preset characters are identical, in advance If character includes: at least one of operator, punctuation mark and number.
To any portion in the various pieces split by preset characters: if character quantity is equal to 1 in the part, Then determine that the type that the part is a character and character is independent variable, if the character quantity in the part is greater than 1, it is determined that The part is a character string, if the character string is identical as one in default reserved word, it is determined that the type of the character string For reserved word type, otherwise determine that the type of the character string is argument types.
It should be noted that the underscore " _ " in punctuation mark in daily life, is not classified as punctuate in this application Underscore " _ " is classified as additional character, underscore and letter type having the same by the scope of symbol, the application, that is to say, that When one character string includes letter and underscore, do not need to split the character string.
If the character quantity in a character group is greater than 1 and including a preset characters, as included fortune in the character group Operator "=" then splits the character group by operator "=", and operator "=" is determined as a character and the word The type of symbol and the type of preset characters are identical.
If the character quantity in a character group is greater than 1 and including at least two preset characters, as wrapped in the character group Include operator "=" and punctuation mark " ", then by operator "=" and punctuation mark " " character group is split, will Operator "=" and punctuation mark " " it is identified as a character and the type of the character and the type of preset characters are identical i.e. Operator "=" is determined as operator type, determine punctuation mark " " for punctuation mark type.
If the character quantity in a character group is greater than 1 and including at least one preset characters, and at least one is default Include at least one number in character, then type decision is carried out to the previous character of the number, the previous word based on number The type of symbol is split.
A kind of feasible pattern that the type of previous character based on number is split is: if the previous word of number The type of symbol is letter, then cannot be split by number to the character group, is otherwise torn open by number to the character group Point.That is, number is followed behind letter, then letter and number is considered as an entirety, number is followed in operator or punctuate Behind symbol, then the number and operator or punctuation mark are split.
In order to make it easy to understand, above-mentioned partitioning scheme is illustrated herein by taking C language as an example:
Firstly, reserved word is the character group of defined mistake in C language, cannot be used again using these words as variable name, If " int " is the character group of defined mistake in C language, then " int " can only be used as reserved word, and cannot be as Independent variable uses, as programmer cannot use int when defining some title;Independent variable is the character of undefined mistake in C language Group, specifically programmer's self-defining character string or character.Such as " pwd_type ", the character string or character string of this definition are subsequent Attribute in use is by programmer's self-defining;Operator is for executing program code operation, and operator is to be arranged in C language Alright, wherein operator includes: unary operation, binocular operation and three mesh operations, and unary operation is that the operator only becomes one Amount is operated, such as "!" (logic NOT);Binocular operation is that the operator operates two variables, such as "=" (assignment operation Symbol);Three mesh operations are that the operator operates three variables, such as "?: " (conditional operator), same punctuation mark It is to be set in C language, this present embodiment is no longer illustrated one by one.It is illustrated for the code to be processed shown in Fig. 3:
First to code to be processed shown in Fig. 3 according to the last one of the first character of every row and the 1st space, every row Character and n-th of space and the two neighboring space of every row are split code to be processed, and obtained each character group is " viod ", " main () { ", " int ", " a ", "=", " 35 ", ";", " int ", " b=4;" " int ", " c " and "=a+b;", In, the character between any two spaces is sky, then gives up the character group.
Character group " 35 " is that all characters are number, it is determined that the character group is numeric type, and the character group Character quantity is greater than 1, determines that the character group is a character string.
Character group " viod ", " int ", " int " and " int " is identical as reserved word, it is determined that reserved word type, and should The character quantity of character group is greater than 1, determines that the character group is a character string.
Character group " a ", " c ", "=" and ";" character quantity be equal to 1, " a ", " c " are determined as letter, and "=" is determined as transporting Operator, ";" it is determined as punctuation mark, and determine that " a ", " c " are letter type, "=" is operator type, ";" it is determined as punctuate Sign pattern, and the character quantity of the character group is equal to 1, determines that the character group is a character.
Character group " b=4;", " main () { " and "=a+b;" character quantity is greater than 1 and including preset characters, then to these Character group is split, by taking character group " main () { " as an example, fractionation obtain " main ", " () ", " ", then the character that will be obtained Group is determined type, determines type and implementation procedure and principle that above-mentioned code is determined type are just as no longer superfluous herein It states.
And the process of pre-set code feature is obtained in the present embodiment as shown in figure 4, may comprise steps of:
S401: it obtains for obtaining the template code of pre-set code feature.Wherein template code is multiple codes to be processed In one, can be specified by programmer or choose one from multiple codes to be processed at random as template code.
S402: every kind of independent corresponding all types adjustment feature of component part in template code is determined.
S403: feature is adjusted to the corresponding all types of independent component part any in every kind of independent component part: such as The all types adjustment corresponding with this kind of independent component part of the independent component part of this kind of fruit corresponding seed type adjustment feature Relationship between feature meets the first preset relation, then is determined as the type adjustment feature for meeting the first preset relation a kind of pre- If code characteristic.
It is to be understood that the independent component part in template code containing different-format, but these different-formats There is corresponding a type of independent component part in independent component part, then for same type of independent composition portion Point, need the format to the independent component part of this type to carry out unification, then in order to obtain the independent composition of this type Partial unified type adjusts feature, needs to obtain all types adjustment feature of the independent component part of this type first (type adjustment feature one kind is considered as a kind of format) then chooses one kind from all types of this type adjustment feature again, Selected type adjustment feature is then the type adjustment feature of this type in pre-set code feature.In the present embodiment, it selects Take the mode of type adjustment feature as follows:
For all types of type adjustment feature, each type adjustment feature of this type is calculated at such The application percentage of all types adjustment feature of type, if application percentage is more than preset threshold (such as 60% but be not limited to 60%), The type adjustment feature that application percentage is more than preset threshold is then determined as a kind of pre-set code feature;If answered in a type Have with the type adjustment feature that ratio is more than preset threshold multiple, then needs from the application percentage of the type to be more than preset threshold One is chosen in type adjustment and is used as a kind of pre-set code feature, selection mode can be but be not limited to: being randomly selected, or It is chosen according to the size of application percentage.
In addition, the present embodiment can also use other in addition to based on the above-mentioned preset threshold as the first preset relation Mode randomly selects one and is used as a kind of pre-set code feature, still such as all types of type adjustment feature For the above-mentioned mode based on the first preset relation, the type adjustment feature selected is possible to not be inconsistent this mode The writing style for closing majority causes the object code exported after adjusting by it to be not easy to understand, therefore the present embodiment is preferred Pre-set code feature is chosen using based on the first preset relation mode.
S404: it determines and is suitable for all kinds of shared adjustment features that every line code shares in template code.
S405: adjustment feature is shared to any sort in all kinds of shared adjustment features: if one in such shares adjustment Relationship between feature and such all shared adjustment feature meets the second preset relation, then will meet being total to for the second preset relation It is determined as a kind of pre-set code feature with adjustment feature.
First preset relation can be equal to for the second preset relation, may also be distinct from that the first preset relation, such as made It is different for the preset threshold of the first preset relation and the value of the preset threshold as the second preset relation, for step S405 with Step S403 is similar, be not illustrated here.
According to the above technical scheme it is found that being extracted from template code special suitable for the pre-set code of each code to be processed Sign, so that the Format adjusting for code to be processed provides adjustment standard, after being adjusted in this way according to pre-set code feature There can be unified format between object code.
Below shown in Fig. 5 for template code, pre-set code is extracted from template code shown in Fig. 5 in conjunction with Fig. 4 elaboration The process of feature, process are as follows:
Character one by one being carried out to template code to read in, first character is " # ", regard as macrodefinition, but whole codes Content is also uncertain, continues to read in " i " " n " " c " " 1 " " u " " d " " e " backward, and next read is " space ", it is no longer Letter, number, underscore, the first character string divided in this way is exactly " #include ", while assert this wardrobe file packet Containing row, several rows later may be characterized and be expert at, be read as backward " null ", continuation is read as " non blank line " backward, this Sample successively extracts feature, extracts backward according to this method it is determined that feature after macrodefinition is " blank line " Feature have:
Header file includes one null of sentence heel, and the application percentage of this feature is 100%;
One level, which is retracted 4 spaces, to be had at 5, and being retracted 2 spaces has at 2, and be retracted 44 spaces feature application than Example is 71%;
It shares 8 binary operators in template code, there is having at 7 for space before and after binary operator, then this feature is answered It is 87% with ratio;
Left brace individually accounts for a line, and the application percentage of feature is 100%;
Right brace individually accounts for a line, and the application percentage of feature is 100%;
A pair of of brace alignment, the application percentage of feature are 100%;
Only one sentence of a line, the application percentage of feature are 100%;
It is more than then preset threshold (such as 60% but be not limited to 60%) it is found that from template generation shown in fig. 5 based on application percentage There is the pre-set code feature extracted in code: header file includes that one null of sentence heel, a level are retracted 4 spaces, double There are space, left brace individually to account for a line before and after mesh operator, right brace individually accounts for a line, a pair of of brace is aligned and a line Only one sentence.
After the pre-set code feature extracted in Fig. 5 is applied to code to be processed shown in Fig. 3, generation to be processed shown in Fig. 3 The code adjustment process of code is as follows:
By code to be processed, character is read in one by one, and first character is " v ", according to C language rule with letter or underscore The symbol of beginning is identifier, but full content can't determine, continues to read in " o " " i " " d " backward, next to read Be " space ", it be no longer letter, number, underscore, first character string divided in this way is exactly " void ", according to this A mode this section of code is split after be respectively " void ", " main ", " (", ") ", " ", " int ", " a ", "=", " 3 ", ";", " int ", " x ", "=", " 5 ", " int ", " b ", "=", " 4 ", ": ", " int ", " c ", "=", " a ", "+", " b ", ";", " ", according to after segmentation character and character string can be extracted from pre-set code feature type adjustment feature have: binocular transport There are space, left and right brace respectively to account for a line and a pair of of brace alignment before and after operator, sharing adjustment feature has: header file includes language Sentence one null of heel, level are retracted 4 spaces and a line only one sentence.Using these to be processed shown in Fig. 3 The object code that code obtains after being adjusted is as shown in fig. 6, make the spy used when preset format and the adjustment of object code It is identical to levy desired format.
For the various method embodiments described above, for simple description, therefore, it is stated as a series of action combinations, but Be those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because according to the present invention, certain A little steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know that, it is retouched in specification The embodiment stated belongs to preferred embodiment, and related actions and modules are not necessarily necessary for the present invention.
Corresponding with above method embodiment, the embodiment of the present invention also provides a kind of code format adjustment device, structure As shown in fig. 7, may include: acquiring unit 11, adjustment unit 12 and output unit 13.
Module 11 is obtained, needs to carry out the code to be processed of code format adjustment for obtaining, for the mode example of acquisition Such as: obtaining the acquisition programmer of module 11 by terminal, such as computer, mobile phone and write one section of program code, when terminal detects journey Sequence written in code is completed, it is meant that terminal obtains code to be processed, and terminal detection program code writes completion and can be detection It is write to programmer's triggering and completes control, save control as programmer clicks, then illustrate that completing primary or part writes.
Module 12 is adjusted, for carrying out Format adjusting to code to be processed based on pre-set code feature, obtains having default The object code of format, wherein pre-set code be characterized in when code to be processed carries out Format adjusting based on adjustment standard so that The preset format that object code has the instruction of pre-set code feature is obtained, being defined from there through pre-set code feature can advise The format of the object code of final output is made, therefore default lattice are able to indicate that by pre-set code feature in the present embodiment Formula.
A kind of adjustment mode is: by artificially providing pre-set code feature, such as: programmer writes one and needs other programs The code skeleton that member follows, the code skeleton define the relationship between every row, each characters/words symbol group, header file and character Requirement, then these requirements can be considered as pre-set code feature, can make in this way object code have programmer Desired unified format, based on only needing to replace the content of code to be processed when writing code to be processed for this mode Fall the content in code skeleton, to obtain the object code for the preset format that there is code skeleton to indicate.
Another feasible mode is: choosing a template code, from multiple codes to be processed with from template code In get pre-set code feature, then again be based on pre-set code Character adjustment.
But for some code to be processed, all features in pre-set code feature can not be all applicable in should be to Code is handled, then needs to extract the feature with code matches to be processed from pre-set code feature at this time, be based on and generation to be processed The matched feature of code carries out Format adjusting to code to be processed, please refers to above method reality for the explanation of pre-set code feature Example is applied, this present embodiment is no longer illustrated.
Output module 13, for exporting the object code with preset format, wherein different codes to be processed is by pre- If the preset format between the object code obtained after code characteristic adjustment is identical.
After pre-set code feature carries out Format adjusting, the format of the object code of output is preset format, so that Format between object code is the same, in this way for being unified format by the format conversion of different codes to be processed For demand, it is only necessary to which pre-set code feature, which is arranged, can be realized, compared to artificial adjustment Format adjusting not only accurate and efficiency but also high.
According to the above-mentioned technical solution, after acquisition needs to carry out the code to be processed of code format adjustment, based on pre- If code characteristic carries out Format adjusting to code to be processed, the object code with preset format is obtained, output has default lattice The object code of formula, so that pre- between the object code that different codes to be processed obtains after pre-set code Character adjustment If format is identical, so that the format of different codes to be processed is realized different to be processed from diversification to uniform transition The uniform format of code, and unified format can allow each programmer to be capable of the thinking and purpose of accurate understanding code, significantly Ground improves the readability of code, and can accurately be changed to code on the basis of accurate understanding thinking and purpose, To be conducive to the modification and maintenance of code, in addition code to be processed can carry out Format adjusting based on pre-set code feature automatically, The link for saving programmer's adjustment or setting format, saves artificial adjustment time, improves regulated efficiency.
A kind of alternative construction for adjusting module 12 in the present embodiment is: adjustment module 12 includes that extraction unit and adjustment are single Member.
Extraction unit, for extracting the feature with the code matches to be processed from pre-set code feature.
Adjustment unit, for carrying out Format adjusting to code to be processed, obtaining based on the feature with code matches to be processed Object code with preset format.
Specific extraction unit can include determining that subelement, type adjustment feature extraction subelement and share adjustment feature Choose subelement.
Determine subelement, it is each only for determining each independent corresponding type of component part in code to be processed Any independent component part is character string or character in vertical component part.It that is, should be wait locate for code to be processed Reason code is made of the independent component part of character string and character both types, it should be noted that character is exactly single word Symbol, and character string is the set of multiple characters, specifically please refers to related method embodiment to the explanation of character and character string, this In be no longer illustrated.
Type adjusts feature extraction subelement, for being based on each independent corresponding type of component part, from default Type corresponding with the type is extracted in code characteristic and adjusts feature, and specific type adjustment feature is for limiting this type Independent component part in write-in the normalized written that follows, as whether the independent component part of this type needs using capitalization Character or lowercase character, this type independent component part and adjacent independent component part between whether have interval etc., it is right The related description in embodiment of the method is please referred in the explanation of type adjustment feature.
Adjustment Feature Selection subelement is shared, shares adjustment feature for choosing from the pre-set code feature, it is described Adjustment feature is shared to be used to carry out format restriction to the part in the code to be processed in addition to the independent component part, That is pre-set code feature is made of type adjustment feature and shared adjustment feature, and shares adjustment and be characterized in being suitable for owning The feature of code to be processed, such as each code to be processed have lines of code, or even further include header file, these as it is multiple to The shared part of code is handled, the format of these contents is defined then sharing adjustment feature and then can be, for sharing The illustration of adjustment feature please refers to related method embodiment and is no longer illustrated here.
According to the above-mentioned technical solution, it needs when carrying out Format adjusting to code to be processed based on code to be processed Independent component part selects the type adjustment feature of the independent component part suitable for the code to be processed, based on applicable Code to be processed is adjusted in the type adjustment feature of the independent component part of the code to be processed and shared adjustment feature, So that code only needs the type adjustment feature based on shared adjustment feature and needed for itself to be adjusted when adjusting.
As shown in figure 8, it illustrates another code formats provided in an embodiment of the present invention to adjust device, on the basis Fig. 7 On can also include: template code obtain module 14, type adjustment characteristic determination module 15 and share adjustment characteristic determination module 16。
Template code obtains module 14, for obtaining the template code for obtaining pre-set code feature.Wherein template generation Code is one in multiple codes to be processed, can be specified by programmer or choose one from multiple codes to be processed at random It is a to be used as template code.
Type adjusts characteristic determination module 15, and for determining, every kind of independent component part is respectively corresponded in the template code All types adjust feature, specifically how to determine in template code all types adjustment feature please refer to correlation technique reality Example is applied, is no longer illustrated here.
Share adjustment characteristic determination module 16, for determine in the template code be suitable for every line code share it is all kinds of Adjustment feature is shared, specifically how to determine that all shared adjustment features in template code please refer to related method embodiment, Here it is no longer illustrated.
According to the above technical scheme it is found that being extracted from template code special suitable for the pre-set code of each code to be processed Sign, so that the Format adjusting for code to be processed provides adjustment standard, after being adjusted in this way according to pre-set code feature There can be unified format between object code.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence " including one ... ", not There is also other identical elements in the process, method, article or apparatus that includes the element for exclusion.
The foregoing description of the disclosed embodiments can be realized those skilled in the art or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest Range.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of code format method of adjustment, which is characterized in that the described method includes:
Obtain the code to be processed for needing to carry out code format adjustment;
Format adjusting is carried out to the code to be processed based on pre-set code feature, obtains the object code with preset format;
The output object code with preset format, wherein different codes to be processed passes through the pre-set code feature tune The preset format between object code obtained after whole is identical.
2. the method according to claim 1, wherein the pre-set code feature that is based on is to the code to be processed Format adjusting is carried out, obtains having the object code of preset format include:
The feature with the code matches to be processed is extracted from the pre-set code feature;
Based on the feature with the code matches to be processed, Format adjusting is carried out to the code to be processed, obtains having default The object code of format.
3. according to the method described in claim 2, it is characterized in that, it is described from the pre-set code feature extract with it is described to Processing code matches feature include:
Each independent corresponding type of component part in the code to be processed is determined, in each independent component part Any independent component part is character string or character;
Based on each independent corresponding type of component part, extracted and the type from the pre-set code feature Corresponding type adjusts feature;
It is chosen from the pre-set code feature and shares adjustment feature, the shared adjustment feature is used for the code to be processed In part in addition to the independent component part carry out format restriction.
4. according to the method described in claim 3, it is characterized in that, each in the determination code to be processed independently form The corresponding type in part includes:
The character group that every line character includes in the code to be processed is obtained, wherein the character group that any one line character includes has: Last character and n-th of space in character group, the line character in the line character between first character and the 1st space Between character group, the character group between i-th of space and i+1 space, wherein the value of i is 2 to arrive n-1, n be it is described to The space sum for including in processing code;
Following steps are executed to any character group:
If the full content that the character group carries is one of number, operator, punctuation mark and default reserved word, it is somebody's turn to do The type of character group is the corresponding type of full content, if character quantity is greater than 1 in the character group, determines that the character group is one A character string determines that the character group is a character if character quantity is equal to 1 in the character group;
If the full content that the character group carries does not include number, operator, punctuation mark and default reserved word, the character The type of group is argument types, if character quantity is greater than 1 in the character group, determines that the character group is a character string, such as Character quantity is equal to 1 in the fruit character group, determines that the character group is a character;
If character quantity is greater than 1 and including at least one preset characters in the character group, by the preset characters to this Character group is split, and preset characters are determined as a character and the type of the character and the type of preset characters are identical, institute Stating preset characters includes at least one of operator, punctuation mark and number;
To any portion in each section split by the preset characters: if character quantity is equal to 1 in the part, Determine that the type that the part is a character and character is argument types, if character quantity is greater than 1 in the part, it is determined that The part is a character string, if the character string is identical as one in default reserved word, it is determined that the type of the character string For reserved word type, otherwise determine that the type of the character string is argument types.
5. the method according to claim 1, wherein the acquisition process of the pre-set code feature includes:
It obtains for obtaining the template code of the pre-set code feature;
Determine every kind of independent corresponding all types adjustment feature of component part in the template code;
Feature is adjusted to the corresponding all types of independent component part any in every kind of independent component part: if this kind of independence Between component part corresponding seed type adjustment feature all types adjustment feature corresponding with this kind of independent component part Relationship meets the first preset relation, then it is special the type adjustment feature for meeting the first preset relation to be determined as a kind of pre-set code Sign;
It determines and is suitable for all kinds of shared adjustment features that every line code shares in the template code;
Adjustment feature is shared to any sort in all kinds of shared adjustment features: if one in such shares adjustment feature and such Relationship between all shared adjustment features meets the second preset relation, then will meet the shared adjustment feature of the second preset relation It is determined as a kind of pre-set code feature.
6. a kind of code format adjusts device, which is characterized in that described device includes:
Module is obtained, needs to carry out the code to be processed of code format adjustment for obtaining;
Module is adjusted, for carrying out Format adjusting to the code to be processed based on pre-set code feature, obtains that there are default lattice The object code of formula;
Output module, for exporting the object code with preset format, wherein described in different code to be processed processes The preset format between object code obtained after pre-set code Character adjustment is identical.
7. device according to claim 6, which is characterized in that the adjustment module includes:
Extraction unit, for extracting the feature with the code matches to be processed from the pre-set code feature;
Adjustment unit, for carrying out Format adjusting to the code to be processed based on the feature with the code matches to be processed, Obtain the object code with preset format.
8. device according to claim 7, which is characterized in that the extraction unit includes:
Determine subelement, it is described each for determining each independent corresponding type of component part in the code to be processed Any independent component part is character string or character in a independent component part;
Type adjusts feature extraction subelement, for being based on each independent corresponding type of component part, from described Type corresponding with the type is extracted in pre-set code feature adjusts feature;
Adjustment Feature Selection subelement is shared, shares adjustment feature for choosing from the pre-set code feature, it is described to share Feature is adjusted to be used to carry out format restriction to the part in the code to be processed in addition to the independent component part.
9. device according to claim 8, which is characterized in that the determining subelement, it is described wait locate specifically for obtaining The character group that every line character includes in reason code, wherein the character group that any one line character includes has: first in the line character Character group in character group, the line character between character and the 1st space between last character and n-th of space, i-th Character group between a space and i+1 space, wherein the value of i is 2 to n-1, includes in the n code to be processed Space sum;
Following steps are executed to any character group:
If the full content that the character group carries is one of number, operator, punctuation mark and default reserved word, it is somebody's turn to do The type of character group is the corresponding type of full content, if character quantity is greater than 1 in the character group, determines that the character group is one A character string determines that the character group is a character if character quantity is equal to 1 in the character group;
If the full content that the character group carries does not include number, operator, punctuation mark and default reserved word, the character The type of group is argument types, if character quantity is greater than 1 in the character group, determines that the character group is a character string, such as Character quantity is equal to 1 in the fruit character group, determines that the character group is a character;
If character quantity is greater than 1 and including at least one preset characters in the character group, by the preset characters to this Character group is split, and preset characters are determined as a character and the type of the character and the type of preset characters are identical, institute Stating preset characters includes at least one of operator, punctuation mark and number;
To any portion in each section split by the preset characters: if character quantity is equal to 1 in the part, Determine that the type that the part is a character and character is argument types, if character quantity is greater than 1 in the part, it is determined that The part is a character string, if the character string is identical as one in default reserved word, it is determined that the type of the character string For reserved word type, otherwise determine that the type of the character string is argument types.
10. device according to claim 6, which is characterized in that described device further include:
Template code obtains module, for obtaining the template code for obtaining the pre-set code feature;
Type adjusts characteristic determination module, and for determining, every kind of independent component part is corresponding all in the template code Type adjusts feature, adjusts feature to the corresponding all types of independent component part any in every kind of independent component part: such as The all types adjustment corresponding with this kind of independent component part of the independent component part of this kind of fruit corresponding seed type adjustment feature Relationship between feature meets the first preset relation, then is determined as the type adjustment feature for meeting the first preset relation a kind of pre- If code characteristic;
Adjustment characteristic determination module is shared, for determining all kinds of shared tune for being suitable for every line code in the template code and sharing Whole feature shares adjustment feature to any sort in all kinds of shared adjustment features: if one in such share adjustment feature with Relationship between such all shared adjustment feature meets the second preset relation, then will meet the shared adjustment of the second preset relation Feature is determined as a kind of pre-set code feature.
CN201811618411.1A 2018-12-27 2018-12-27 Code format adjusting method and device Active CN109683881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811618411.1A CN109683881B (en) 2018-12-27 2018-12-27 Code format adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811618411.1A CN109683881B (en) 2018-12-27 2018-12-27 Code format adjusting method and device

Publications (2)

Publication Number Publication Date
CN109683881A true CN109683881A (en) 2019-04-26
CN109683881B CN109683881B (en) 2022-04-05

Family

ID=66190111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811618411.1A Active CN109683881B (en) 2018-12-27 2018-12-27 Code format adjusting method and device

Country Status (1)

Country Link
CN (1) CN109683881B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486566A (en) * 2020-10-23 2021-03-12 百果园技术(新加坡)有限公司 Code file processing method, device, equipment and storage medium
CN112631606A (en) * 2020-12-31 2021-04-09 中国农业银行股份有限公司 Script formatting method and device
CN113703736A (en) * 2021-08-31 2021-11-26 四川启睿克科技有限公司 Web project code optimization method
CN113791768A (en) * 2021-09-22 2021-12-14 海通证券股份有限公司 Code generation method and device, storage medium and terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6226658B1 (en) * 1998-06-19 2001-05-01 Hewlett-Packard Company Layout code tuning in universally readable document files
CN104050085A (en) * 2014-06-25 2014-09-17 北京思特奇信息技术股份有限公司 Forced code standard inspection method and system
CN107357733A (en) * 2017-07-17 2017-11-17 万帮充电设备有限公司 Improve the method and device of code quality
CN107885715A (en) * 2017-11-23 2018-04-06 掌阅科技股份有限公司 Composition method, electronic equipment and the computer-readable storage medium of code information
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6226658B1 (en) * 1998-06-19 2001-05-01 Hewlett-Packard Company Layout code tuning in universally readable document files
CN104050085A (en) * 2014-06-25 2014-09-17 北京思特奇信息技术股份有限公司 Forced code standard inspection method and system
CN107357733A (en) * 2017-07-17 2017-11-17 万帮充电设备有限公司 Improve the method and device of code quality
CN107885715A (en) * 2017-11-23 2018-04-06 掌阅科技股份有限公司 Composition method, electronic equipment and the computer-readable storage medium of code information
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486566A (en) * 2020-10-23 2021-03-12 百果园技术(新加坡)有限公司 Code file processing method, device, equipment and storage medium
CN112631606A (en) * 2020-12-31 2021-04-09 中国农业银行股份有限公司 Script formatting method and device
CN113703736A (en) * 2021-08-31 2021-11-26 四川启睿克科技有限公司 Web project code optimization method
CN113791768A (en) * 2021-09-22 2021-12-14 海通证券股份有限公司 Code generation method and device, storage medium and terminal

Also Published As

Publication number Publication date
CN109683881B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN109683881A (en) A kind of code format method of adjustment and device
CN101216803B (en) Test program control stream path set creation method based on base path
CN104317589B (en) A kind of code automatic generation method and device for being used to load dynamic link library
CN105138335B (en) A kind of function call path extraction method and device based on controlling stream graph
CN103473171A (en) Coverage rate dynamic tracking method and device based on function call paths
CN106528399A (en) Test case determination method and apparatus
CN107329747A (en) A kind of method and device for generating multi-threaded pattern
CN107273117A (en) A kind of quick Code automatic build system for programming friendly
CN106648587A (en) Annotation-based Web application code generation method
CN102722616B (en) Method for drawing exploration point plan based on Excel
CN106599039A (en) Statistical representation method supporting free combination and nesting of data in relational database
CN106648819A (en) Internationalized code conversion method based on editor
CN103885770A (en) Implementation method for retrieving assembly files from executable files for single chip microcomputer
CN108647146A (en) The method for generating test case of combined covering is judged based on correction conditions
CN105893482A (en) Engine test data fully-automatic extracting and Word report generating method
CN106484892A (en) Data manipulation method and device
CN105893016A (en) Log recording system and method based on MVC (Model View Controller) framework
CN101196963A (en) Indexing system and method of generic chemical structure
CN103995873A (en) Data mining method and data mining system
CN107103035A (en) This earth's surface data-updating method and device
CN106096159B (en) A kind of implementation method of distributed system behavior simulation analysis system under cloud platform
CN106598843A (en) Method for automatic identification of software log behaviors based on program analysis
Thomas et al. Documentation for software engineers: what is needed to aid system understanding?
CN109710304A (en) A kind of Format adjusting method and device
CN103810365A (en) Automatic grading method based on hydroelectric simulation training system

Legal Events

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