CN103646055B - The acquisition methods and device of a kind of programme setting - Google Patents

The acquisition methods and device of a kind of programme setting Download PDF

Info

Publication number
CN103646055B
CN103646055B CN201310629039.5A CN201310629039A CN103646055B CN 103646055 B CN103646055 B CN 103646055B CN 201310629039 A CN201310629039 A CN 201310629039A CN 103646055 B CN103646055 B CN 103646055B
Authority
CN
China
Prior art keywords
file
configuration
node
grand
information
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.)
Active
Application number
CN201310629039.5A
Other languages
Chinese (zh)
Other versions
CN103646055A (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201310629039.5A priority Critical patent/CN103646055B/en
Publication of CN103646055A publication Critical patent/CN103646055A/en
Application granted granted Critical
Publication of CN103646055B publication Critical patent/CN103646055B/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/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The embodiment of the invention discloses the acquisition methods of programme setting and device, applied to field of computer technology.In the acquisition methods of the programme setting of the embodiment of the present invention, configuration file in the source code of application program can be parsed, and the nodal information and branch node information of configuration information tree are set respectively according to the macrodefinition and grand conditional expression that are resolved to, so as to which by the unified output of obtained configuration information tree, the configuration information tree can just represent the relation between each configuration item that the source code file of application program includes.So when searching each function correspondence configuration item, it can be searched by the information on each node and branch node, the content of each configuration item in source code file each compare by independent storage in the prior art, and the method for the present embodiment can simplify the process of the lookup for configuration item.

Description

The acquisition methods and device of a kind of programme setting
Technical field
The present invention relates to the acquisition methods and device of field of computer technology, more particularly to programme setting.
Background technology
It can include source file and configuration file in an application program correspondence source code directory, be wrapped in configuration file The content of multiple configuration items of the application program is included, a configuration item can represent one achieved by the application program here Function.When the function of each in application program is updated and upgraded, it is necessary to first find each function in source code file The content of correspondence configuration item, the operation for being then updated and upgrading again, but in the prior art, application program each match somebody with somebody The content for putting item is all respective independent storage in source code file, and form is indefinite so that searching each function correspondence During the content of configuration item, comparatively laborious and difficulty.
The content of the invention
The embodiment of the present invention provides the acquisition methods and device of programme setting, simplifies the mistake of the lookup for configuration item Journey.
The embodiment of the present invention provides a kind of acquisition methods of programme setting, including:
Determine configuration file to be operated in the source code directory of application program;
The configuration file is parsed, when the macrodefinition being resolved in the configuration file, by the macrodefinition It is stored into configuration information tree in the content information of present node;
When the grand conditional expression being resolved in the configuration file, match somebody with somebody according to being set the grand conditional expression Put the branch node of interdependent node in inforamtion tree.
By the corresponding configuration information tree output of the configuration file.
The embodiment of the present invention provides a kind of acquisition device of programme setting, including:
Configure configuration file to be operated in determining unit, the source code directory for determining application program;
Resolution unit, for being parsed to the configuration file;
Endpoint processing unit, for be resolved to when the resolution unit in the configuration file macrodefinition when, will be described Macrodefinition is stored into configuration information tree in the content information of present node;
Branch node processing unit, for the grand conditional expression being resolved to when the resolution unit in the configuration file When, the branch node of interdependent node in the configuration information tree is set according to the grand conditional expression;
Output unit, the corresponding configuration information tree of the configuration file is exported.
, can be by matching somebody with somebody in the source code of application program in the acquisition methods of the programme setting of the embodiment of the present invention Put file to be parsed, and the letter of the node of configuration information tree is set according to the macrodefinition and grand conditional expression that are resolved to respectively The information of breath and branch node, so that by the unified output of obtained configuration information tree, the configuration information tree can just represent application Relation between each configuration item that the source code file of program includes.So when searching each function correspondence configuration item, Can be searched by the information on each node and branch node, and in the prior art the content of each configuration item in source Each independent storage is compared in code file, and the method for the present embodiment can simplify the process of the lookup for configuration item.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also To obtain other accompanying drawings according to these accompanying drawings.
Fig. 1 is a kind of acquisition methods flow chart of programme setting provided in an embodiment of the present invention;
Fig. 2 is the schematic diagram of the configuration information tree of the acquisition device setting of Program configuration information of the embodiment of the present invention;
Fig. 3 is the acquisition methods flow chart of another programme setting provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of the acquisition device of programme setting provided in an embodiment of the present invention;
Fig. 5 is the structural representation of the acquisition device of another programme setting provided in an embodiment of the present invention;
Fig. 6 is the structural representation of the acquisition device of another programme setting provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of acquisition methods of programme setting, mainly the source code text from application program Obtained in part, the method for the present embodiment be the method performed by the acquisition device of programme setting, flow chart as shown in figure 1, Including:
Step 101, configuration file to be operated in the source code directory of application program is determined, source code directory refers to here Store the path of the source code of application program.
It is appreciated that configuration file and source file can be included in the source code directory of an application program, wherein configuring File includes the content of multiple configuration items, and a configuration item can represent the One function of the application program;Source file It is the code file for realizing application program.The acquisition device of programme setting, can be with source code mesh when performing this step Configuration root file in record is starting point, is searched in source code directory comprising instruction(That is #include)Respective file is as waiting to grasp The configuration file of work.In order to simplify the processing time to configuration file, the acquisition device of programme setting will first can not have File is first filtered out, specifically, and the acquisition device of programme setting, can be with source code directory when performing this step In configuration root file be starting point, search source code directory in comprising instruction correspondence configuration file, and will comprising instruction correspondence The file matched in file with profile is filtered, and will be matched somebody with somebody after filtering comprising instruction respective file as to be operated Put file.Wherein, profile can be otiose file, such as backs up file(Using bak as suffix), code release control File(Using CVS or svn as suffix)With system library file(Using stdio.h as suffix)Deng, configuration root file be that user specifies Specific one configuration file in above-mentioned source code directory.
Further, in order to not interfere with the normal operation of the application program, the acquisition device of programme setting can be with The configuration file to be operated of determination is first stored into an operating path, then the configuration for being stored in the operating path File carries out the operation of following steps 102 to 104.
Step 102, the configuration file to be operated determined in step 101 is parsed, when being resolved in configuration file Macrodefinition when, then perform step 103;When the grand conditional expression being resolved in configuration file, then step 104 is performed.
The acquisition device of programme setting can proceed by parsing from configuration root file, first set up configuration information tree Root node, then while performing the parsing of this step, while the result obtained according to parsing is created, the application program is corresponding to match somebody with somebody Inforamtion tree is put, wherein whenever some grand conditional expression is resolved to, the movement of node can be carried out.What is be wherein resolved to is grand fixed Justice refers to that definition one is grand, and its keyword is " #define ", and grand here is a kind of compiler pretreatment order;Grand conditional expression Refer on grand conditional relationship formula, can mainly include but be limited to following several types:Into the first table of a Ge Xin branches Up to formula, its keyword can be " #if ", " #ifdef ", and " #ifndef " etc.;Exit current branch and enter another new branch The second expression formula, its keyword can be " #elif " and " #else " etc.;Exit current branch but do not enter another new branch The 3rd expression formula, its keyword be " #endif ".
Step 103, macrodefinition is stored into configuration information tree in the content information of present node.If the macrodefinition is When being that starting point is parsed from configuration root file, just it is resolved to before macrodefinition expression formula is resolved to, then works as prosthomere Point is the corresponding root node of configuration root file;If the macrodefinition is resolved to after a certain grand conditional expression is resolved to , then present node is the corresponding node of the grand conditional expression.
Step 104, the branch node of interdependent node in configuration information tree is set according to grand conditional expression.
Specifically, different operations can be performed according to different grand conditional expressions, such as entering the of new branch One expression formula, then the acquisition device of programme setting the first child node can be set up under the present node of configuration information tree, and First expression formula is stored into the identification information of the first child node, present node refers to be solved before first expression formula here The corresponding node of a certain grand conditional expression analysed, or root node;For exiting current branch and entering another new branch Second expression formula, then the acquisition device of programme setting can exit the present node of configuration information tree, return to and built under father node The second child node is found, and the second expression formula is stored into the identification information of the second child node, father node is present node here Father node, present node here refers to the corresponding section of a certain grand conditional expression being resolved to before second expression formula Point, or root node;The 3rd expression formula for exiting current branch, then exit the present node of configuration information tree, here work as The corresponding node of a certain grand conditional expression that front nodal point refers to be resolved to before the 3rd expression formula, or root node.On It is, to the setting and enlarging of configuration information tree and dynamic change, not imply that configuration with according to analysis result to state present node The node that some in inforamtion tree is fixed.
During implementing, the acquisition device of programme setting is storing each above-mentioned expression formula for child node Identification information when, expression formula can be removed space and operator and extracted etc. after simple process, obtain the corresponding pass of expression formula Key word(key)And condition value(id)Stored etc. information.
For example, for the source code of following configuration file:
Then programme setting acquisition device during being parsed to configuration file, can be in present node Under set up three child nodes, present node is a certain grand condition being resolved to before the grand conditional expression of the if here The node of expression formula, the identification information of these three child nodes is respectively that wherein OP is operator(operator):
KEY:CVTE_MACRO_NAME_FEATURE, ID:CVTE_OPTION1, OP:==
KEY:CVTE_MACRO_NAME_FEATURE, ID:CVTE_OPTION2, OP:==
KEY:CVTE_MACRO_NAME_FEATURE, ID:CVTE_OPTION3, OP:==
It should be noted that in the case that condition in some grand conditional expressions is more complicated, can be directly by table Up to identification information of the formula as the child node, such as " #if((A==B)&&(C==D)&&(E))", can be by(A==B)&&(C== D)&&(E)It is used as the identification information of the child node.And there is no listing condition in some grand conditional expressions, such as " #else " point The no listing condition of branch, can add else sequence number as identification information.
Step 105, after step 103 or 104, configuration file to be operated is all parsed when according to above-mentioned steps 102 After the completion of, it is possible to the corresponding configuration information tree of configuration file to be operated is exported, specifically, can be by configuration information tree The information of each node(Including identification information and content information etc.)Export in a unified format, such as with XML (extensible Markup Language) (EXtensible Markup Language, XML)File etc. type is exported.If configuration file to be operated is without all It is parsed, then needs to continue the execution analyzing step of return to step 102.
It should be noted that the content information of each node includes the information of macrodefinition, node in above-mentioned configuration information tree Identification information be grand conditional expression information, and it is grand can represent the function i.e. configuration item that the application program can be performed, Therefore configuration information tree can represent the relation in the application program between each configuration item.Configuration information for example shown in Fig. 2 In tree, it is the information that client 3 is arrived on client 1 respectively that can include 3 nodes, and node client 2 can include 3 sons Node is that the demand 1 of client 2 arrives the information of demand 3, corresponding function 1 and 2 in the child node of demand 1, in the child node of demand 2 Middle corresponding function 1 and 3, corresponding function 2 and 4 in the child node of demand 3.
In addition, above-mentioned first expression formula is not offered as order to the 3rd expression formula, and the first child node and the second child node Relation, but in order to illustrate different expression formulas and different child nodes.
It can be seen that, can be by the source code of application program in the acquisition methods of the programme setting of the embodiment of the present invention In configuration file parsed, and the section of configuration information tree is set according to the macrodefinition and grand conditional expression that are resolved to respectively Point information and branch node information, so that by the unified output of obtained configuration information tree, the configuration information tree can just represent should Relation between each configuration item included with the source code file of program.So searching each function correspondence configuration item When, it can be searched by the information on each node and branch node, and the content of each configuration item in the prior art Each independent storage is compared in source code file, and the method for the present embodiment can simplify the process of the lookup for configuration item.
And it is each it is possible to further in configuration information tree in a unified format input database, will can thus realize The functions such as the online query of individual configuration item.
With reference to shown in Fig. 3, in a specific embodiment, the configuration file to be operated determined in above-mentioned steps 101 In in addition to macrodefinition and grand conditional expression, can also include deleting the letter that macrodefinition, grand annotation information and file be included Breath, then the acquisition device of programme setting is when performing above-mentioned steps 102, if the grand annotation in configuration file is resolved to During information, step 106 can be performed;If in the deletion macrodefinition in being resolved to configuration file, step 107 can be performed;If When the file in being resolved to configuration file is comprising instruction, step 108 can be performed, specifically:
Step 106, grand annotation information is stored into configuration information tree in the grand content information of the same name of corresponding node, this In grand annotation information refer to the code in source code is marked and necessary explanation information.
Such as, it is as follows for the grand grand annotation information for CVTE_MACRO_NAME_FEATURE:
/***************CVTE_MACRO_NAME_FEATURE*****************
(1)Default value:
(2)Range specification:
(3)Function is described:
(4)Author's & dates:
**************************************************************/
The first row of grand annotation information includes grand title, is that the grand attributive character is described in detail afterwards, Such as default value, range specification and function description etc..When being resolved to above-mentioned grand annotation information, by the specific of grand annotation information Content storage to and be associated with grand CVTE_MACRO_NAME_FEATURE information.
Step 107, increase in configuration information tree in the content information of present node the deletion macrodefinition correspondence it is grand by The information of deletion, the present node refers to be resolved to the corresponding node of a grand conditional expression before the deletion macrodefinition, Or root node.
Step 108, locating file includes the corresponding file of instruction, and suspends parsing current file, starts parsing and finds File, this document include instruction keyword be:#include filenames, if file name can be double quotation marks mode Filename be the filename of " FILE " or angle brackets mode i.e.<FILE>, can also be macro name.
Wherein, for the filename of double quotation marks mode, then the acquisition device of programme setting, can be with locating file Carried out first in the configuration file to be operated determined in above-mentioned steps 101 and in path of this document comprising instruction The filename in double quotation marks is searched, if further this is searched do not find file comprising instructing corresponding file first, The scope of ff can be expanded, the filename in double quotation marks is searched again in the source code directory of application program;It is right Refer to the file in compiler storehouse in the filename respective file of angle brackets mode, it is uncorrelated to configuration information, this can be ignored Class file;If filename is macro name, searched in the content information of the corresponding child node of present node of configuration information tree Macro name, the corresponding node of a certain grand conditional expression that present node refers to be resolved to before the macro name here, and should Grand conditional expression corresponding node includes multiple child nodes, or root node.
In general when file is comprising instruction correspondence macro name, for logical consistency, the generation of following form is only supported Code:
In the code, it is desirable to which macrodefinition has child node A in the direct child node of present node under present node Situation, and child node B situation, then when be resolved to file comprising instruction correspondence macro name INC when, then need in this little section The macro name is searched in the content information of point.If searched in the content information of child node less than the macro name, neglected Slightly.
So, in embodiments of the present invention, after step 103 or 104 or 106 or 107 or 108, when according to above-mentioned steps 102 by after the completion of configuration file to be operated all parsing, it is possible to export the corresponding configuration information tree of configuration file.
The embodiment of the present invention also provides a kind of acquisition device of programme setting, its structural representation as shown in figure 4, bag Include:
Configure configuration file to be operated in determining unit 10, the source code directory for determining application program;In order to not The normal operation of application program is influenceed, the configuration file to be operated of determination can be first stored into one by the configuration determining unit 10 In individual operating path, other steps are then performed by other units again.
Resolution unit 11, for being parsed to the configuration file to be operated that the configuration determining unit 10 is determined.
Endpoint processing unit 12, for when the resolution unit 11 is resolved to the macrodefinition in the configuration file, inciting somebody to action The macrodefinition is stored into configuration information tree in the content information of present node.
Branch node processing unit 13, for the grand condition table being resolved to when the resolution unit 11 in the configuration file During up to formula, the branch node of interdependent node in the configuration information tree is set according to the grand conditional expression.
Output unit 14, the corresponding configuration information tree of the configuration file is exported.When resolution unit 11 is by configuration information After all having parsed, output unit 14 can export the information of each node in configuration information tree in a unified format.And should Configuration information tree in unified form input database, can so be facilitated user's networking to search each configuration by output unit 14 The content of item.
In the acquisition device of the programme setting of the embodiment of the present invention, resolution unit 11 can be by the source of application program Configuration file in code is parsed, and grand according to what is be resolved to by endpoint processing unit 12 and branch node processing unit 13 Definition and grand conditional expression set the nodal information and branch node information of configuration information tree respectively, so that output unit 14 will The obtained unified output of configuration information tree, it is each that the configuration information tree can just represent that the source code file of application program includes Relation between individual configuration item.So when searching each function correspondence configuration item, each node and branch node can be passed through On information searched, and the content of each configuration item respective independent storage phase in source code file in the prior art Than the method for the present embodiment can simplify the process of the lookup for configuration item.
With reference to shown in Fig. 5, in a specific embodiment, the acquisition device of programme setting is except that can include such as Outside structure shown in Fig. 4, further, configuration determining unit 10 therein can be by searching unit 110 or single by searching Member 110 and filter element 120 are realized, and branch node processing unit 13 can specifically pass through first processing units 131, second Processing unit 132 and the 3rd processing unit 133 realizes, specifically:
Searching unit 110, for using the configuration root file in the source code directory as starting point, searching the source code Comprising instruction respective file in catalogue, the configuration root file is a certain configuration file in the source code directory;
Filter element 120, for by the searching unit 110 search comprising instruction respective file in profile phase The file of matching is filtered.
First processing units 131, if being resolved to grand conditional expression for the resolution unit 11 is included into new First expression formula of branch, then set up the first child node under the present node of the configuration information tree, and by first table The identification information of first child node is stored into up to formula;
Second processing unit 132, works as if being resolved to grand conditional expression for the resolution unit 11 and including exiting Preceding branch and the second expression formula for entering another new branch, then exit the present node of the configuration information tree, under father node The second child node is set up, and second expression formula is stored into the identification information of second child node;
3rd processing unit 133, works as if being resolved to grand conditional expression for the resolution unit 11 and including exiting 3rd expression formula of preceding branch, then exit the present node of the configuration information tree.
Above-mentioned first processing units 131 and second processing unit 132 are storing the mark that each above-mentioned expression formula is child node When knowing information, expression formula can be removed after the simple process such as space and operator extraction, obtain the corresponding keyword of expression formula (key)And condition value(id)Stored etc. information.
In the present embodiment, can find the searching unit 110 configured in determining unit 10 is literary comprising instruction correspondence Part further, in order to simplify the processing time to configuration file, can determine configuration single as configuration file to be operated The instruction respective file that includes after filter element 120 in member 10 is filtered is used as the configuration file to be operated.And this implementation In example, output unit 14 can be with the information of the node set in output node processing unit 12, and branch node processing unit 13 The information for the child node that middle first processing units 131 and second processing unit 132 are set.
With reference to shown in Fig. 6, in a specific embodiment, the acquisition device of programme setting is except that can include such as Outside structure shown in Fig. 4, annotation process unit 15, delete processing unit 16 and file can also be included and include processing unit 17, And in a specific embodiment, file can pass through the first searching unit 171, the second searching unit comprising processing unit 17 172 realize with resolution unit 173 is searched, wherein:
Annotation process unit 15, for the grand annotation information being resolved to when the resolution unit 11 in the configuration file When, the grand annotation information is stored into the configuration information tree in the grand content information of the same name of corresponding node;
Delete processing unit 16, for the deletion macrodefinition being resolved to when the resolution unit 11 in the configuration file When, increase the grand deleted letter of the deletion macrodefinition correspondence in the content information of present node in the configuration information tree Breath.
File includes processing unit 17, and the file for being resolved to when resolution unit 11 in the configuration file includes finger Order, searches the file and includes the corresponding file of instruction, and suspends parsing current file, starts the text found described in parsing Part.
First searching unit 171, if being resolved to file for the resolution unit 11 includes the corresponding filename of instruction It is the filename of double quotation marks mode, then includes instruction in the configuration file neutralization file to be operated of the determination Path in searched filename in double quotation marks first;If it is described search first do not find the file comprising instruction Corresponding file, then searched the file in double quotation marks again in the source code directory;
Second searching unit 172, if being resolved to file for the resolution unit 11 includes the corresponding filename of instruction It is macro name, then searches the macro name in the content information of the corresponding child node of present node of the configuration information tree;
Resolution unit 173 is searched, is found for parsing the searching unit 172 of the first searching unit 171 or second File.
In the present embodiment, output unit 14 can also export note in the information of each node in exporting configuration information tree The grand annotation information stored in processing unit 15 is released, can be included with output file and resolution unit 173 is searched in processing unit 17 The information for finding file of parsing.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can To instruct the hardware of correlation to complete by program, the program can be stored in a computer-readable recording medium, storage Medium can include:Read-only storage(ROM), random access memory(RAM), disk or CD etc..
The acquisition methods and device of the programme setting provided above the embodiment of the present invention are described in detail, Specific case used herein is set forth to the principle and embodiment of the present invention, and the explanation of above example is to use Understand the method and its core concept of the present invention in help;Simultaneously for those of ordinary skill in the art, according to the present invention's Thought, will change in specific embodiments and applications, in summary, and this specification content should not be construed as Limitation of the present invention.

Claims (10)

1. a kind of acquisition methods of programme setting, it is characterised in that including:
Determine configuration file to be operated in the source code directory of application program;
The configuration file is parsed, when the macrodefinition being resolved in the configuration file, the macrodefinition stored Into configuration information tree in the content information of present node, setting of the present node according to analysis result to configuration information tree With enlarging dynamic change;
When the grand conditional expression being resolved in the configuration file, the movement of node is carried out, is expressed according to different grand conditions Formula performs different operations, and the branch node of interdependent node in the configuration information tree is set according to the grand conditional expression;
By the corresponding configuration information tree output of the configuration file;
The branch node of interdependent node, is specifically included in the configuration information tree according to the grand conditional expression setting:
If the grand conditional expression includes the first expression formula into new branch, in the current of the configuration information tree The first child node is set up under node, and first expression formula is saved as to the identification information of first child node;
If the grand conditional expression includes exiting current branch and enters the second expression formula of another new branch, exit The present node of the configuration information tree, is returned to and the second child node is set up under father node, and second expression formula is saved as The identification information of second child node;
If the grand conditional expression includes exiting the 3rd expression formula of current branch, the configuration information tree is exited Present node.
2. the method as described in claim 1, it is characterised in that to be operated in the source code directory of the determination application program Configuration file, is specifically included:
Using the configuration root file in the source code directory as starting point, search in the source code directory comprising instruction correspondence text Part is used as the configuration file to be operated;Or,
Using the configuration root file in the source code directory as starting point, search corresponding comprising instruction in the source code directory File, and will be filtered in the respective file comprising instruction with the file that profile matches, after the filtering The configuration file to be operated is used as comprising instruction respective file;
The configuration root file is a certain configuration file in the source code directory.
3. method as claimed in claim 2, it is characterised in that described to export the corresponding configuration information tree of the configuration file Before, in addition to:
When the grand annotation information being resolved in the configuration file, the grand annotation information is stored into the configuration information tree In the grand content information of the same name of middle corresponding node;
When the deletion macrodefinition being resolved in the configuration file, the content information of present node in the configuration information tree Middle increase is described to delete the grand deleted information of macrodefinition correspondence.
4. the method as described in any one of claims 1 to 3, it is characterised in that described by the corresponding configuration of the configuration file Before inforamtion tree output, in addition to:
When the file being resolved in the configuration file includes instruction, search the file and include the corresponding file of instruction, and temporarily Stop parsing current file, start the file found described in parsing.
5. method as claimed in claim 4, it is characterised in that the lookup file has comprising corresponding file is instructed Body includes:
If the file is comprising the filename that corresponding filename is double quotation marks mode is instructed, in the to be operated of the determination Configuration file neutralize the filename searched first in the path of the file comprising instruction in double quotation marks;
If described search first does not find the file comprising corresponding file is instructed, enter in the source code directory Row searches the file in double quotation marks again;
If the file is macro name comprising corresponding filename is instructed, in the present node correspondence of the configuration information tree Child node content information in search the macro name.
6. a kind of acquisition device of programme setting, it is characterised in that including:
Configure configuration file to be operated in determining unit, the source code directory for determining application program;
Resolution unit, for being parsed to the configuration file;
Endpoint processing unit, for be resolved to when the resolution unit in the configuration file macrodefinition when, will be described grand fixed Justice is stored into configuration information tree in the content information of present node, and the present node is according to analysis result to configuration information tree Setting and enlarging dynamic change;
Branch node processing unit, for be resolved to when the resolution unit in the configuration file grand conditional expression when, The movement of node is carried out, different operations are performed according to different grand conditional expressions, institute is set according to the grand conditional expression State the branch node of interdependent node in configuration information tree;
Output unit, the corresponding configuration information tree of the configuration file is exported;
The branch node processing unit is specifically included:
First processing units, if including the first expression formula into new branch for the grand conditional expression, in institute The first child node is set up under the present node for stating configuration information tree, and first expression formula is saved as into first child node Identification information;
Second processing unit, if including exiting current branch for the grand conditional expression and entering another new branch Second expression formula, then exit the present node of the configuration information tree, returns to and the second child node is set up under father node, and will be described Second expression formula saves as the identification information of second child node;
3rd processing unit, if including exiting the 3rd expression formula of current branch for the grand conditional expression, is moved back Go out the present node of the configuration information tree.
7. device as claimed in claim 6, it is characterised in that the configuration determining unit includes searching unit, and will be described What searching unit was found includes instruction respective file as the configuration file to be operated;
Or the configuration determining unit includes searching unit and filter element, and instruction will be included after filter element filtering Respective file is used as the configuration file to be operated;
The searching unit, for using the configuration root file in the source code directory as starting point, searching the source code mesh Comprising instruction respective file in record, the configuration root file is a certain configuration file in the source code directory;
The filter element, includes what is matched in instruction respective file with profile for search the searching unit File is filtered.
8. device as claimed in claim 7, it is characterised in that also include:
Annotation process unit, for be resolved to when the resolution unit in the configuration file grand annotation information when, will be described Grand annotation information is stored into the configuration information tree in the grand content information of the same name of corresponding node;
Delete processing unit, for be resolved to when the resolution unit in the configuration file deletion macrodefinition when, described Increase the grand deleted information of the deletion macrodefinition correspondence in configuration information tree in the content information of present node.
9. the device as described in any one of claim 6 to 8, it is characterised in that also include:
File includes processing unit, for including instruction when the file being resolved in the configuration file, searches the file bag Containing the corresponding file of instruction, and suspend parsing current file, start the file found described in parsing.
10. device as claimed in claim 8, it is characterised in that the file is specifically included comprising processing unit:
First searching unit, if including the filename for instructing corresponding filename to be double quotation marks mode for the file, Searched first in path of the configuration file neutralization file comprising instruction to be operated of the determination double Filename in quotation marks;If described search first does not find the file comprising corresponding file is instructed, in the source The file in double quotation marks is searched in code directory again;
Second searching unit, instructs corresponding filename to be macro name if included for the file, matches somebody with somebody confidence described The macro name is searched in the content information for the corresponding child node of present node for ceasing tree;
Resolution unit is searched, for parsing the file that first searching unit or the second searching unit are found.
CN201310629039.5A 2013-11-29 2013-11-29 The acquisition methods and device of a kind of programme setting Active CN103646055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310629039.5A CN103646055B (en) 2013-11-29 2013-11-29 The acquisition methods and device of a kind of programme setting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310629039.5A CN103646055B (en) 2013-11-29 2013-11-29 The acquisition methods and device of a kind of programme setting

Publications (2)

Publication Number Publication Date
CN103646055A CN103646055A (en) 2014-03-19
CN103646055B true CN103646055B (en) 2017-09-26

Family

ID=50251269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310629039.5A Active CN103646055B (en) 2013-11-29 2013-11-29 The acquisition methods and device of a kind of programme setting

Country Status (1)

Country Link
CN (1) CN103646055B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104361055B (en) * 2014-10-31 2017-09-05 山东中创软件工程股份有限公司 A kind of method and system of parsing Apache configuration files
CN107608704A (en) * 2017-11-02 2018-01-19 金蝶软件(中国)有限公司 A kind of XML configuration file update method, system, medium and device
CN108108300B (en) * 2017-12-18 2020-06-16 北京东土科技股份有限公司 Resource allocation detection method and device for operating system
CN112015906A (en) * 2020-08-06 2020-12-01 东北大学 Construction scheme of network configuration knowledge graph
CN113553297B (en) * 2021-06-08 2023-01-06 优刻得科技股份有限公司 Management method and system for switch configuration information

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6105063A (en) * 1998-05-05 2000-08-15 International Business Machines Corp. Client-server system for maintaining application preferences in a hierarchical data structure according to user and user group or terminal and terminal group contexts

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6105063A (en) * 1998-05-05 2000-08-15 International Business Machines Corp. Client-server system for maintaining application preferences in a hierarchical data structure according to user and user group or terminal and terminal group contexts

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
《.NET Framework Configuration总结》;泉子;《博客园》;20100911;第1-4页 *
《Struts2框架核心配置文件的研究与应用》;刘艳春等;《计算机技术与发展》;20130228;第23卷(第2期);I138-224 *
《一个WinForm程序配置信息的简单模型和维护工具——使用说明》;泉子;《博客园》;20100920;第1-6页 *
《一个WinForm程序配置信息的简单模型和维护工具——设计说明》;泉子;《博客园》;20100918;第1-6页 *
《嵌入式系统软件开发平台配置管理技术的研究与实现》;李向蔚;《中国优秀硕士学位论文全文数据库 信息科技辑》;20051115(第7期);第77-81页 *

Also Published As

Publication number Publication date
CN103646055A (en) 2014-03-19

Similar Documents

Publication Publication Date Title
CN103646055B (en) The acquisition methods and device of a kind of programme setting
US6931590B2 (en) Method and system for managing documents
EP2784665B1 (en) Program and version control method
US9026948B2 (en) Multi-faceted relationship hubs
KR20170023022A (en) Code recommendation
EP3117342A1 (en) Framework for data extraction by examples
WO2013158758A1 (en) Semantic source code searching
JP2000181917A (en) Structured document managing method, executing device therefor and medium recording processing program therefor
JP4547300B2 (en) Common query graph pattern generation device, generation method, generation program, and common subgraph search device, search method, and search program using the same
JP6132698B2 (en) Tabular multidimensional data conversion method and apparatus
JP2009521026A (en) Method and system for editing text with search and replace functions that leverage derivation of search and replace inputs
WO2015010509A1 (en) One-dimensional liner space-based method for implementing trie tree dictionary search
WO2017058047A1 (en) Method of preparing documents in markup languages
JP5347965B2 (en) XML data processing system, data processing method used in the system, and XML data processing control program
Wielemaker et al. Using Prolog as the fundament for applications on the semantic web
Vrgoc et al. MillenniumDB: a persistent, open-source, graph database
CN110309214B (en) Instruction execution method and equipment, storage medium and server thereof
JP4025178B2 (en) Structured data search method, structured data search device and program
Vrgoč et al. MillenniumDB: A Persistent, Open-Source, Graph Database
Wessman et al. A generalized framework for an ontology-based data-extraction system
US7949656B2 (en) Information augmentation method
US9189249B2 (en) Method for automatically defining icons
JP2009211599A (en) Mapping definition creation system and mapping definition creation program
CN108279905A (en) The method and device of library file is introduced in a kind of component
CN113094036A (en) Software engineering directory structure annotation aerial view generation method and system

Legal Events

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