CN111708540B - Variable parameter function analysis method, analyzer and storage device - Google Patents
Variable parameter function analysis method, analyzer and storage device Download PDFInfo
- Publication number
- CN111708540B CN111708540B CN202010364978.1A CN202010364978A CN111708540B CN 111708540 B CN111708540 B CN 111708540B CN 202010364978 A CN202010364978 A CN 202010364978A CN 111708540 B CN111708540 B CN 111708540B
- Authority
- CN
- China
- Prior art keywords
- function
- embedded
- parameter
- variable parameter
- operator
- 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
Links
- 238000004458 analytical method Methods 0.000 title claims abstract description 35
- 230000006870 function Effects 0.000 claims abstract description 354
- 230000014509 gene expression Effects 0.000 claims abstract description 45
- 238000000034 method Methods 0.000 claims abstract description 36
- 238000010586 diagram Methods 0.000 description 8
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a variable parameter function analysis method, a variable parameter function analyzer and a variable parameter function storage device. The method comprises the following steps: acquiring an expression of a variable parameter function and description information of an embedded function in the variable parameter function, analyzing the expression of the variable parameter function, sequentially reading elements in the expression, and if the elements are function names of the embedded function, analyzing the embedded function according to the function names, parameter delimiters and the description information of the embedded function to acquire an execution result of the embedded function, and putting the execution result into an operation queue as an operand; if the element is an operator, operate Fu Zhan the operation Fu Yaru; after the execution results of all the embedded functions adjacent to the operator are put in the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue. Through the mode, the method and the device can solve the problem that the real parameter number cannot be determined, and therefore support of the function analyzer on the variable parameter function is achieved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, a parser, and a storage device for parsing a variable parameter function.
Background
In an interpreter implementation, one of the heaviest steps is to convert a prefix expression into a prefix or suffix expression for computer processing. In a function parser implemented based on a dispatch field algorithm, for a function of a fixed parameter, the boundaries of the parameter may be determined according to the number. When the number of function parameters is not determined, additional boundary information needs to be provided.
The existing technical scheme cannot determine the real parameter number of the variable parameter function, different function names are required to be provided for function interfaces with the same function and different parameter numbers, the uniformity of the function names is violated, and the flexibility of the user on the function is also lacking.
Disclosure of Invention
The application provides a variable parameter function analysis method, a parameter analyzer and a storage device, which can solve the problem that the real parameter number cannot be determined, thereby realizing the support of the function analyzer to the variable parameter function.
In order to solve the technical problems, the application adopts a technical scheme that: the method for analyzing the variable parameter function comprises the following steps:
acquiring an expression of a variable parameter function and description information of an embedded function in the variable parameter function, wherein the expression comprises a function name of the embedded function, a parameter delimiter of the embedded function and operators among the embedded functions, the parameter delimiter is adjacent to the function name and is used for indicating real parameters of the embedded function, the description information of the embedded function comprises the minimum parameter number and the maximum parameter number of the embedded function, and the variable parameter function comprises at least two embedded functions;
analyzing the expression of the variable parameter function, sequentially reading elements in the expression,
if the element is a function name of the embedded function, analyzing the embedded function according to the function name, the parameter delimiter and the description information of the embedded function, acquiring an execution result of the embedded function, and putting the execution result into an operation queue as an operand;
if the element is an operator, operate Fu Zhan the operation Fu Yaru;
after the execution results of all the embedded functions adjacent to the operator are put in the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue.
In order to solve the technical problems, the application adopts another technical scheme that: provided is a variable parameter function analysis device, including:
the function acquisition module is used for acquiring an expression of a variable parameter function and description information of an embedded function in the variable parameter function, wherein the expression comprises a function name of the embedded function, a parameter delimiter of the embedded function and an operator between the embedded functions, the parameter delimiter is adjacent to the function name and is used for indicating real parameters of the embedded function, the description information of the embedded function comprises the minimum parameter number and the maximum parameter number of the embedded function, and the variable parameter function comprises at least two embedded functions.
The function analysis module is used for analyzing the expression of the variable parameter function, sequentially reading elements in the expression, analyzing the embedded function according to the function name, the parameter delimiter and the description information of the embedded function if the elements are the function names of the embedded function, acquiring an execution result of the embedded function, and putting the execution result into an operation queue as an operand; if the element is an operator, the operation Fu Yaru is an operator stack.
And the function output module is used for popping the operators from the operation Fu Zhan after the execution results of all embedded functions adjacent to the operators are put into the operation queue, and inserting the popped operators into the operation queue.
In order to solve the technical problems, the application adopts another technical scheme that: providing a variable parameter function analyzer, wherein the variable parameter function analyzer comprises a processor and a memory coupled with the processor, and the memory stores program instructions for realizing the variable parameter function analyzing method; the processor is configured to execute the program instructions stored in the memory to parse the parametric function.
In order to solve the technical problems, the application adopts a further technical scheme that: a storage device is provided, which stores a program file capable of implementing the above-described variable parameter function analysis method.
The beneficial effects of the application are as follows: according to the variable parameter function analysis method, the analyzer and the storage device, the embedded function is analyzed according to the function name, the parameter delimiter and the description information of the embedded function, the execution result of the embedded function is obtained, the execution result is taken as an operand to be put into an operation queue, the operation Fu Yaru is operated Fu Zhan, after the execution results of all the embedded functions adjacent to the operator are put into the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue, so that the analysis of the variable parameter function is completed.
Drawings
FIG. 1 is a flow chart of a method for parsing a variable parameter function according to a first embodiment of the present application;
FIG. 2 is an exemplary diagram of a method of parametric analysis according to one embodiment of the present application;
FIG. 3 is a schematic diagram of a parametric function analysis device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a variogram parser in accordance with one embodiment of the present application;
fig. 5 is a schematic structural diagram of a memory device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," and the like in this disclosure are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", and "a third" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise. All directional indications (such as up, down, left, right, front, back … …) in embodiments of the present application are merely used to explain the relative positional relationship, movement, etc. between the components in a particular gesture (as shown in the drawings), and if the particular gesture changes, the directional indication changes accordingly. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
For ease of understanding, the variate function and its parsing will be described first, where the variate function may have at least M parameters and at most N parameters to perform the operation (M < =n), and in the implementation of the interpreter, one of the heaviest steps is to convert the prefix expression into the prefix expression or the suffix expression, so as to facilitate computer processing. When using a shoving-hard algorism to convert a suffix expression into a suffix expression (i.e. an inverse Polish expression), the integer values over the interval where the parameter number pc of the variable parameter function is [ M, N ] can be resolved correctly, and in a function resolver implemented based on the dispatch field Algorithm, the boundaries of the parameters can be determined according to the number for a function of fixed parameters. When the number of the function parameters is uncertain, boundary information needs to be additionally provided, in one embodiment, the function analysis firstly needs to add boundary marks to the variable parameter function, the boundary marks are inserted into a queue firstly, then the queue is inserted according to a function analysis algorithm, the function real parameters are acquired according to the parameter boundary values when the function is analyzed, a result of executing the function is obtained, and the result is stacked as an operand to obtain a standard dispatching field algorithm expression. When parameters of the variable parameter function are not fixed, the method needs to rely on the input of a user, and for functions with the same functions and different parameters, different function names need to be provided, so that the uniformity of the function names is violated, and the user lacks flexibility in using the functions. Therefore, the application provides a variable parameter function analysis method which can well solve the problem that the real parameter number cannot be determined, thereby realizing the support of a function analyzer on the variable parameter function.
Referring to fig. 1, fig. 1 is a flow chart of a method for analyzing a variable parameter function according to a first embodiment of the present application. It should be noted that, if there are substantially the same results, the method of the present application is not limited to the flow sequence shown in fig. 1. As shown in fig. 1, the method comprises the steps of:
step S101: the method comprises the steps of obtaining an expression of a variable parameter function and description information of an embedded function in the variable parameter function, wherein the expression comprises a function name of the embedded function, a parameter delimiter of the embedded function and operators among the embedded functions, the parameter delimiter is adjacent to the function name and is used for indicating real parameters of the embedded function, the description information of the embedded function comprises the minimum parameter number and the maximum parameter number of the embedded function, and the variable parameter function comprises at least two embedded functions.
It should be noted that, in the field of computer science, a dispatching field algorithm is a method for parsing a mathematical expression, especially a suffix expression. The algorithm can output a character string of a suffix mark method or an abstract grammar tree structure, and is named as a dispatching field algorithm because the operation of the algorithm is similar to that of a railway dispatching field, a function expression is similar to a train on the railway, each carriage is an embedded function, the connection among the carriages is an operator, the dispatching field algorithm dispatches the embedded function to an output queue, dispatches the operator to operation Fu Zhan, and extracts and outputs the suffix expression which is finally analyzed from the output queue and the operator stack according to a certain rule during final output.
In step S101, before analyzing the variable parameter function, an expression of the variable parameter function needs to be obtained, where the expression of the variable parameter function includes a function name of an embedded function in the variable parameter function, a parameter delimiter, and an operator between the embedded functions, the parameter delimiter is adjacent to the function name and is used to indicate actual parameters of the embedded function, and the operator is used to indicate an operational relationship between the embedded functions. In this embodiment, the function name of the embedded function may have the same function name as the variable parameter function, and the parameter delimiters of the plurality of embedded functions may also be the same.
Further, the description information of the embedded function in the variable parameter function may include the minimum parameter number and the maximum parameter number of the embedded function, and in this embodiment, the variable parameter function includes at least two embedded functions, for example: the obtained expression of the variable parameter function comprises three embedded functions with the same function names, namely a first embedded function, a second embedded function and a third embedded function, wherein a first operator is arranged between the first embedded function and the second embedded function, a second operator is arranged between the second embedded function and the third embedded function, the description information of the embedded functions is the minimum parameter number 1 and the maximum parameter number 3, and the parameter delimiters of the first embedded function, the second embedded function and the third embedded function are the same, for example, the parameter delimiters are all the same in sign "(", the parameter decomposer of the first embedded function indicates that the real parameter of the first embedded function is a first parameter, the parameter decomposer of the second embedded function indicates that the real parameter of the second embedded function is a second parameter, and the parameter decomposer of the third embedded function indicates that the real parameter of the third embedded function is a third parameter.
Step S102: and analyzing the expression of the variable function, sequentially reading the elements in the expression, executing step S103 if the elements are the function names of the embedded functions, and executing step S104 if the elements are operators.
It should be noted that after the expression of the variable parameter function is obtained, analysis is performed according to a certain reading sequence, and in the analysis process, elements in the expression of the variable parameter function are sequentially judged, where the elements may include two kinds of elements: function name, operator of embedded function.
Step S103: analyzing the embedded function according to the function name, the parameter delimiter and the description information of the embedded function, acquiring an execution result of the embedded function, and putting the execution result into an operation queue as an operand.
In step S103, if the element currently obtained is the function name of the embedded function when the expression of the variable parameter function is analyzed, in this embodiment, the parameter delimiter is put into the operation queue first; after the parameter delimiters are put into an operation queue, determining parameters of the embedded function according to the parameter delimiters, and judging whether the number of the parameters is larger than or equal to the minimum number of the parameters and smaller than or equal to the maximum number of the parameters; if yes, sequentially placing the parameters and the function names of the embedded functions into an operation queue.
Still further, the method includes the steps of setting the parameter delimiter of the first embedded function in the operation queue if the element obtained at present is the function name of the embedded function, determining whether the number of the first parameters of the first embedded function determined by the parameter delimiter is greater than or equal to the minimum parameter number 1 and less than or equal to the maximum parameter number 3, and setting the first parameters and the function name of the first embedded function in the operation queue in sequence if the number of the parameters in the first parameters is 1 and the number of the parameters is within the minimum parameter number and the maximum parameter number.
In another embodiment, determining the parameters of the embedded function according to the parameter delimiters may further determine the elements read between two reads of the parameter delimiters as parameters of the embedded function.
Further, an execution result of the embedded function is obtained, the execution result is taken as an operand and put into an operation queue, a value of a parameter of the embedded function can be obtained, the embedded function is called, the execution result is obtained through operation, the first parameter is substituted into the first embedded function for calculation to obtain a first result, and the first result is taken as the operand and put into the operation queue. The analysis process of each embedded function is the same, when the acquired element is the function name of the embedded function, the embedded function is analyzed into a parameter delimiter, the real parameter of the embedded function and the execution result of the embedded function, and the parameter delimiter, the real parameter of the embedded function and the execution result of the embedded function are put into an operation queue as operands.
It should be noted that, in step S103, the number of real parameters of different embedded functions may be different, for example: the number of first parameters of the first embedded function may be 1, the number of second parameters of the second embedded function may be 2, and the number of third parameters of the third embedded function may be 3, wherein the third parameters may include the second parameters or the first parameters, and the second parameters may include the first parameters.
Step S104: the operation Fu Yaru operator stack.
In step S104, if the expression of the argument function is parsed, the element currently acquired is an operator. The operation Fu Yaru operator stack is performed. With the above example, when the first embedded function is parsed, the first operator after the first embedded function is obtained, and the operation Fu Yaru operator stack is performed.
Further, after stacking the operation Fu Yaru operator, an operand corresponding to an embedded function that is adjacent to the operator and whose execution result has been placed in the operation queue is inserted into the output queue.
Step S105: after the execution results of all the embedded functions adjacent to the operator are put in the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue.
In this embodiment, after the analysis results of all the embedded functions adjacent to the operators are placed in the operation queue, and after the execution results are calculated according to the parameters of the embedded functions, when the output queue outputs the analysis results of the embedded functions, the operators are popped from the operation Fu Zhan, the popped operators are inserted into the operation queue, and then the analysis results are sequentially output.
Still further to the above description, when the first parameter is substituted into the first embedded function to calculate a first result, and the first operator is pushed into the operator stack, the second embedded function is parsed according to the method of parsing the first embedded function, and the second parameter of the second embedded function is substituted into the calculation to obtain a second result and put into the output queue, and then the first operator is popped out of the stack and output to the output queue, and then the second operator between the second embedded function and the third embedded function is obtained in the process of continuing parsing, and the second operator is pushed into the operation Fu Zhan, and then the third embedded function is obtained in the process of continuing parsing, and still the third embedded function is parsed according to the method described above, and after the third result of the third embedded function is output to the output queue, the second operator is popped out of the stack and added into the output queue, and after the parsing of all embedded functions of the variable parameter function is completed, the result is sequentially output.
Referring to fig. 2 together, fig. 2 is an exemplary diagram of a method for parsing a variable parameter function according to an embodiment of the application. The method of parametric function analysis is illustrated in the following with specific examples, for example: the variable parameter function is characterized in that the description information of the function contains at least one parameter, and at most three parameters can be used, namely M=1 and N=3, the actual parameters of the function are represented by a1, a2 and a3, the actual parameters of the functions are different, a1, a2 and a3 are only placeholders, and Funcaresult is a unified placeholder of a function execution result. The analytical expression: funcA (a 1) -FuncA (a 1, a 2) +FunctA (a 1, a2, a 3) by the following procedure:
(a) Inputting analytical expressions FuncA (a 1) -FuncA (a 1, a 2) +functa (a 1, a2, a 3), wherein FuncA (a 1) is a first embedded function, funcA (a 1, a 2) is a second embedded function, functA (a 1, a2, a 3) is a third embedded function, "-" is a first operator located between the first and second embedded functions, "+" is a second operator located between the second and third embedded functions, and inserting the first embedded function FuncA (a 1) into an operation queue;
(b) Parsing the first embedded function FuncA (a 1) into a first parameter delimiter "(", a first parameter "a1", a first function name FuncA;
(c) Pushing the first operator "-" into an operator stack;
(d) Obtaining a first execution result FuncAResult by combining the description information of the embedded function of the first embedded function, and inserting the second embedded function FuncA (a 1, a 2) into an output queue;
(e) Parsing the second embedded function FuncA (a 1, a 2) into a second parameter delimiter "(", second parameter "a1, a2", second function name FuncA;
(f) Combining the description information of the embedded function of the second embedded function to obtain a second execution result FuncAResult;
(g) Popping a first operator "-" in the operator stack;
(h) Pushing the second operator "+" into an operator stack;
(i) Inserting the third embedded function FunctA (a 1, a2, a 3) into an operation queue;
(j) Parsing the third embedded function FunctA (a 1, a2, a 3) into a third parameter delimiter "(", third parameters "a1, a2, a3", third function name FuncA;
(k) Combining the description information of the embedded function of the second embedded function to obtain a third execution result FuncARESult;
(l) Popping a second operator "+" from the operator stack;
and (m) outputting the first execution result, the second execution result, the third execution result and the first operator and the second operator which are sequentially arranged from one side, namely, the analysis formula of the variable parameter function.
According to the variable parameter function analysis method, the embedded function is analyzed according to the function name, the parameter delimiter and the description information of the embedded function, the execution result of the embedded function is obtained, the execution result is taken as an operand to be put into an operation queue, the operation Fu Yaru is operated Fu Zhan, after all the execution results of the embedded function adjacent to the operator are put into the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue, so that the analysis of the variable parameter function is completed.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a parametric function analysis device according to an embodiment of the application. As shown in fig. 3, the apparatus includes a function acquisition module 21, a function analysis module 22, and a function output module 23.
The function obtaining module 21 is configured to obtain an expression of a variable parameter function and description information of an embedded function in the variable parameter function, where the expression includes a function name of the embedded function, a parameter delimiter of the embedded function, and an operator between the embedded functions, the parameter delimiter is adjacent to the function name and is used to indicate actual parameters of the embedded function, and the description information of the embedded function includes a minimum parameter number and a maximum parameter number of the embedded function, and the variable parameter function includes at least two embedded functions.
The function analysis module 22 is configured to analyze the expression of the variable parameter function, sequentially read elements in the expression, analyze the embedded function according to the function name, the parameter delimiter and the description information of the embedded function if the elements are function names of the embedded function, obtain an execution result of the embedded function, and put the execution result into an operation queue as an operand; if the element is an operator, the operation Fu Yaru is an operator stack.
Optionally, the function parsing module 22 may be further configured to put the parameter delimiter into an operation queue first; after the parameter delimiters are put into an operation queue, determining parameters of the embedded function according to the parameter delimiters, and judging whether the number of the parameters is larger than or equal to the minimum number of the parameters and smaller than or equal to the maximum number of the parameters; if yes, sequentially placing the parameters and the function names of the embedded functions into an operation queue.
Optionally, the function parsing module 22 may be further configured to obtain a value of a parameter of the embedded function, call the embedded function, and calculate to obtain the execution result.
Optionally, the function parsing module 22 may be further configured to determine the element read between the two reads to the parameter delimiters as the parameter of the embedded function.
And the function output module 23 is configured to, after placing execution results of all embedded functions adjacent to the operator in an operation queue, pop the operator from the operation Fu Zhan, and insert the popped operator into the operation queue.
Optionally, the function output module 23 may be further configured to insert, after stacking the operation Fu Yaru operator, an operand corresponding to an embedded function that is adjacent to the operator and whose execution result has been put in the operation queue into the output queue.
According to the variable parameter function analyzing device, the embedded function is analyzed according to the function name, the parameter delimiter and the description information of the embedded function, the execution result of the embedded function is obtained, the execution result is taken as an operand to be put into an operation queue, the operation Fu Yaru is operated Fu Zhan, after all the execution results of the embedded function adjacent to the operator are put into the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue, so that the analysis of the variable parameter function is completed.
It is understood that the specific manner of implementing each function by each module of the variable parameter function analysis device may refer to the specific steps corresponding to the above embodiment, so that the description thereof will not be repeated here.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a variogram parser according to an embodiment of the application. As shown in fig. 4, the variogram analyzer 60 includes a processor 61 and a memory 62 coupled to the processor 61.
The memory 62 stores program instructions for implementing the variable parameter function analysis method according to any of the above embodiments.
The processor 61 is arranged to execute program instructions stored in the memory 62 for parsing the parametric functions.
The processor 61 may also be referred to as a CPU (Central Processing Unit ). The processor 61 may be an integrated circuit chip with signal processing capabilities. Processor 61 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a memory device according to an embodiment of the application. The storage device of the embodiment of the present application stores a program file 71 capable of implementing all the above-mentioned variogram analysis methods, where the program file 71 may be stored in the storage device in the form of a software product, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage device includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes, or a terminal device such as a computer, a server, a mobile phone, a tablet, or the like.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. The foregoing is only the embodiments of the present application, and therefore, the patent scope of the application is not limited thereto, and all equivalent structures or equivalent processes using the descriptions of the present application and the accompanying drawings, or direct or indirect application in other related technical fields, are included in the scope of the application.
Claims (7)
1. A method of parametric function analysis, the method comprising the steps of:
acquiring an expression of a variable parameter function and description information of an embedded function in the variable parameter function, wherein the expression comprises a function name of the embedded function, a parameter delimiter of the embedded function and operators among the embedded functions, the parameter delimiter is adjacent to the function name and is used for indicating real parameters of the embedded function, the description information of the embedded function comprises the minimum parameter number and the maximum parameter number of the embedded function, and the variable parameter function comprises at least two embedded functions;
analyzing the expression of the variable parameter function, sequentially reading elements in the expression,
if the element is a function name of the embedded function, analyzing the embedded function according to the function name, the parameter delimiter and the description information of the embedded function, acquiring an execution result of the embedded function, and putting the execution result into an operation queue as an operand;
if the element is an operator, operate Fu Zhan the operation Fu Yaru;
after the execution results of all the embedded functions adjacent to the operator are put in the operation queue, the operator is popped from the operation Fu Zhan, and the popped operator is inserted into the operation queue.
2. The method for parsing a variable parameter function according to claim 1, wherein parsing the embedded function based on the function name, the parameter delimiter, and the description information of the embedded function comprises:
firstly, putting the parameter delimiter into an operation queue;
after the parameter delimiters are put into an operation queue, determining parameters of the embedded function according to the parameter delimiters, and judging whether the number of the parameters is larger than or equal to the minimum number of the parameters and smaller than or equal to the maximum number of the parameters;
if yes, sequentially placing the parameters and the function names of the embedded functions into an operation queue.
3. The method for parsing a variable parameter function according to claim 2, wherein the determining the parameter of the embedded function according to the parameter delimiter includes:
the element read between the two reads to the parameter delimiter is determined as the parameter of the embedded function.
4. The method for parsing a variable parameter function according to claim 2, wherein the obtaining the execution result of the embedded function includes:
and acquiring the value of the parameter of the embedded function, calling the embedded function, and calculating to obtain the execution result.
5. A variogram analysis method as in any one of claims 1 to 4, wherein: after stacking the operation Fu Yaru operators, operands corresponding to the embedded functions that are adjacent to the operators and whose execution results have been placed into the operation queue are inserted into the output queue.
6. A parametric function parser, characterized by: the variogram analyzer comprises a processor, a memory coupled to the processor, wherein,
the memory stores program instructions for implementing the variogram analysis method according to any one of claims 1 to 5;
the processor is configured to execute the program instructions stored in the memory to implement parsing of the variable parameter function.
7. A storage device storing a program file for implementing the variable parameter function analysis method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010364978.1A CN111708540B (en) | 2020-04-30 | 2020-04-30 | Variable parameter function analysis method, analyzer and storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010364978.1A CN111708540B (en) | 2020-04-30 | 2020-04-30 | Variable parameter function analysis method, analyzer and storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111708540A CN111708540A (en) | 2020-09-25 |
CN111708540B true CN111708540B (en) | 2023-11-28 |
Family
ID=72536562
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010364978.1A Active CN111708540B (en) | 2020-04-30 | 2020-04-30 | Variable parameter function analysis method, analyzer and storage device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111708540B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4787035A (en) * | 1985-10-17 | 1988-11-22 | Westinghouse Electric Corp. | Meta-interpreter |
CN102393818A (en) * | 2011-07-21 | 2012-03-28 | 福州锐达数码科技有限公司 | Digital function graph drawing method |
CN108491207A (en) * | 2018-03-02 | 2018-09-04 | 平安科技(深圳)有限公司 | Expression processing method, apparatus, equipment and computer readable storage medium |
CN108563610A (en) * | 2017-07-28 | 2018-09-21 | 上海云角信息技术有限公司 | A kind of mathematical function CAI software based on mixed reality |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007014276A2 (en) * | 2005-07-25 | 2007-02-01 | Hercules Software, Llc | Direct execution virtual machine |
-
2020
- 2020-04-30 CN CN202010364978.1A patent/CN111708540B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4787035A (en) * | 1985-10-17 | 1988-11-22 | Westinghouse Electric Corp. | Meta-interpreter |
CN102393818A (en) * | 2011-07-21 | 2012-03-28 | 福州锐达数码科技有限公司 | Digital function graph drawing method |
CN108563610A (en) * | 2017-07-28 | 2018-09-21 | 上海云角信息技术有限公司 | A kind of mathematical function CAI software based on mixed reality |
CN108491207A (en) * | 2018-03-02 | 2018-09-04 | 平安科技(深圳)有限公司 | Expression processing method, apparatus, equipment and computer readable storage medium |
Non-Patent Citations (2)
Title |
---|
基于调度场算法实现长逻辑表达式解析与创建;张文晓;;信息与电脑(理论版)(第06期);全文 * |
数学表达式遥测工程参数解析***实现;何华;商临峰;;飞行器测控学报(第02期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111708540A (en) | 2020-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108491207B (en) | Expression processing method, device, equipment and computer readable storage medium | |
WO2012072039A1 (en) | Software upgrade method and apparatus | |
CN111427569B (en) | Method and device for adapting installation-free program, electronic equipment and storage medium | |
CN110532107B (en) | Interface calling method, device, computer equipment and storage medium | |
CN109614327B (en) | Method and apparatus for outputting information | |
CN107943877A (en) | The generation method and device of content of multimedia to be played | |
CN111181805B (en) | Micro-service test baffle generation method and system based on test case | |
CN112631924A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN112631649A (en) | Intelligent contract management method, device, terminal equipment and medium | |
CN111124541B (en) | Configuration file generation method, device, equipment and medium | |
CN115167718A (en) | OFD document local amplification display method, device, equipment and storage medium | |
CN106843857B (en) | Method and device for realizing SDK (software development kit) conversion of code base based on SRP (sequence-related protocol) | |
CN111708540B (en) | Variable parameter function analysis method, analyzer and storage device | |
CN105278928A (en) | IVR external interface configuration method and IVR external interface configuration device | |
CN111125605B (en) | Page element acquisition method and device | |
CN110532193A (en) | A kind of method for analyzing performance, calculates equipment and storage medium at device | |
CN114896161A (en) | File construction method and device based on artificial intelligence, computer equipment and medium | |
CN111539200B (en) | Method, device, medium and electronic equipment for generating rich text | |
CN112379967B (en) | Simulator detection method, device, equipment and medium | |
CN114611500A (en) | Expression processing method and device, electronic equipment and computer readable storage medium | |
CN112882937A (en) | Test case processing method and device, computer equipment and storage medium | |
CN108304188B (en) | Data type conversion method and terminal | |
CN113822046B (en) | Analysis method, device, equipment and storage medium based on document test case | |
CN107330000A (en) | The player method and device of news video | |
CN116069633B (en) | Code checking method and device, electronic equipment and storage medium |
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 |