Method and device for analyzing programming language, and computer program
By separating and converting the source code into a vocabulary unit without uncertain symbols, the error problem of the interpreter when dealing with numerical programming languages is solved, and processing accuracy is improved.
Patent Information
- Application Number
- JP2024540883
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-20
- Filing Date
- 2022-09-15
- Publication Date
- 2025-02-12
- Estimated Expiration
- 2042-09-15
AI Technical Summary
Existing interpreters are prone to errors when dealing with numerical programming languages due to uncertainty in mathematical symbols.
By identifying the source code as a string and parsing it into a list containing multiple vocabulary units, the first vocabulary unit containing the uncertain symbol and the second vocabulary unit without the uncertain symbol are separated, and the first vocabulary unit is converted into the second vocabulary unit, semantic analysis and grammatical analysis are performed to eliminate uncertainty.
Improves the accuracy of the interpreter's numerical programming language and reduces the occurrence of errors.
Smart Images

Figure 2025504376000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the software field, and more particularly to a programming language analysis method and device, and a non-volatile storage medium. [Background technology]
[0002] FIG. 1 is a schematic diagram of the compilation execution process of a conventional high-level programming language. As shown in FIG. 1, the compilation execution process of a high-level language involves three types of formats as shown in FIG. 1: a) a compiled language (e.g., C language), in which a source code is converted by a compiler into a binary executable program and directly executed by a machine; b) a first-class interpreted language (e.g., Java language), in which a source code is converted by an interpreter into an intermediate code (e.g., bytecode), which is interpreted and executed in a virtual machine; and c) a second-class interpreted language (e.g., Lisp language), in which a source code is directly interpreted and executed by an interpreter.
[0003] A compiler is a program that translates and writes a source language program (usually a high-level language) into a target language (usually a machine language represented in binary). Figure 2 is a flowchart of the compiler's execution process, and the entire compilation process can be roughly divided into six steps, as shown in Figure 2: syntax analysis, semantic analysis, intermediate code generation, code optimization, and target code generation.
[0004] Figure 3 is a flowchart showing the operation procedure of an interpreter, and as shown in Figure 3, an interpreter is a program that interprets and executes source code. The entire interpretation process is roughly divided into four steps, including lexical analysis, syntactic analysis, semantic analysis, and intermediate code generation or direct interpretation and execution.
[0005] 1) The lexical analyzer scans the strings of characters that make up the source program, i.e., reads the source program character by character from left to right, then identifies words (also called word symbols or symbols) based on word formation rules and reorganizes them into a list of lexical units.
[0006] 2) The parser uses the first component of each lexical unit obtained by lexical analysis to create a syntax tree, where each internal node in the tree represents an operation and the subnodes of the node represent the components of the operation. Syntax analysis is a logical step that determines whether the structure of the source program is correct.
[0007] 3) The semantic analyzer uses the information in the syntax tree and the symbol table to check whether the source program matches the meaning defined by the language, while simultaneously collecting type information and generating an abstract syntax tree. Semantic analysis is a logical step that performs checks on structurally correct source programs for context-related properties, primarily type checking.
[0008] Existing interpreters are sufficient to process general programming languages such as Lisp, but are insufficient to process numerical programming languages. Numerical languages introduce more mathematical symbols, which makes some symbols ambiguous, i.e., there is ambiguous code in the source code. For example, a single quote in a source code can indicate the start or end of a character, and can also be used to indicate a matrix transpose. If the single quote indicates the start or end of a character, its type is a delimiter, and if the single quote indicates a matrix transpose, its type is an operator. If the single quote is a different type, the generated syntax tree and the abstract syntax tree are essentially different. Based on the architecture of existing interpreters, the interpreter processes the single quote only as one fixed type, which causes errors in the results.
[0009] No effective solution has been provided for the problem that the ambiguity of mathematical symbols introduced into a numerical programming language makes it prone to errors when an interpreter processes the numerical programming language. Summary of the Invention [Problem to be solved by the invention]
[0010] The embodiments of the present application provide a method and device for analyzing a programming language, and a non-volatile storage medium, which at least solve the technical problem that mathematical symbols introduced into a numerical calculation programming language have ambiguity, making it prone to errors when an interpreter processes the numerical calculation programming language. [Means for solving the problem]
[0011] According to one aspect of an embodiment of the present application, the method includes the steps of identifying a source code as a string of characters and parsing the string into a lexical unit list including a plurality of lexical units; dividing the plurality of lexical units into first related lexical units which are lexical units including a polysemous symbol and second related lexical units which are lexical units not including a polysemous symbol; converting the first related lexical units into the second related lexical units; and analyzing the second related lexical units obtained by converting the first related lexical units and the second related lexical units obtained by classifying the plurality of lexical units.
[0012] Alternatively, the step of dividing the multiple lexical units into first and second similar lexical units includes the steps of acquiring token names of the multiple lexical units, identifying a target token name having ambiguity from the token names, and identifying the lexical unit to which the target token name belongs as the first similar lexical unit, and identifying the lexical unit to which token names other than the target token name belong as the second similar lexical unit.
[0013] Alternatively, the step of converting the first related lexical unit into the second related lexical unit includes a step of inputting the first related lexical unit into a semantic analyzer for analysis to obtain the second related lexical unit, and the step of analyzing the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units includes a step of inputting the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units into a syntactic analyzer for analysis, and a step of inputting the analysis result of the syntactic analyzer on the second related lexical unit into the semantic analyzer for analysis.
[0014] Alternatively, the step of inputting the first synonymous lexical unit into a semantic analyzer for analysis to obtain the second synonymous lexical unit includes the steps of identifying a token name type of the first synonymous lexical unit based on context information of the first synonymous lexical unit, and modifying an attribute value of the first synonymous lexical unit based on the token name type of the first synonymous lexical unit to obtain the second synonymous lexical unit.
[0015] Alternatively, the step of inputting the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units into a syntactic parser for analysis includes a step of assembling the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units into a syntactic parse tree.
[0016] Alternatively, the step of inputting the analysis result of the syntactic parser for the second class lexical unit to a semantic analyzer for analysis includes a step of performing a simplification process on the syntactic parse tree and constructing an abstract syntax tree.
[0017] Alternatively, parsing the string into a lexical unit list comprises parsing the string into a lexical unit list according to pre-defined word construction rules, each lexical unit in the lexical unit list comprising a token name and an attribute value, the token name being the lexical unit itself and the attribute value being a type of the lexical unit.
[0018] According to another aspect of an embodiment of the present application, there is further provided an apparatus for parsing a programming language, the apparatus including: a first parsing module configured to identify a source code as a string and parse the string into a lexical unit list including a plurality of lexical units; a classification module configured to separate the plurality of lexical units into first related lexical units which are lexical units including a polysemous symbol and second related lexical units which are lexical units not including a polysemous symbol; a conversion module configured to convert the first related lexical units into the second related lexical units; and a second parsing module configured to perform analysis on the second related lexical units obtained by converting the first related lexical units and the second related lexical units obtained by classifying the plurality of lexical units.
[0019] According to yet another aspect of an embodiment of the present application, there is further provided a non-volatile storage medium containing a program stored thereon, the program, when executed, controlling a device in which the program is located to perform the above-described method of parsing a programming language.
[0020] According to yet another aspect of an embodiment of the present application, there is further provided a processor adapted to execute a program stored in a memory, the processor executing the above-mentioned method for parsing a programming language when the program is executed.
[0021] In an embodiment of the present application, a step of identifying a source code as a string, and parsing the string into a lexical unit list including a plurality of lexical units, a step of dividing the plurality of lexical units into a first related lexical unit which is a lexical unit including an ambiguous symbol and a second related lexical unit which is a lexical unit not including an ambiguous symbol, a step of converting the first related lexical unit into a second related lexical unit, and a step of analyzing the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the plurality of lexical units, is used to perform a classification process on the lexical unit list based on the result of the lexical analysis, and converts the ambiguous lexical units into ambiguous lexical units, thereby achieving the objective of improving the ability of the interpreter to process ambiguous code, achieving the technical effect of improving the accuracy with which the interpreter processes a numerical computation programming language, and further solving the technical problem that the ambiguity of mathematical symbols introduced into a numerical computation programming language makes it easy for an interpreter to cause errors when processing a numerical computation programming language. [Brief description of the drawings]
[0022] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and the exemplary embodiments and the description thereof are used to interpret the present application and do not constitute undue limitations on the present application.
[0023] [Figure 1] FIG. 1 is a schematic diagram of a current high-level programming language compilation and execution process. [Diagram 2] 1 is a flowchart of a compiler execution process. [Diagram 3] 1 is a flowchart of an interpreter execution process. [Figure 4] 1 is a flowchart of a method for analyzing a programming language according to an embodiment of the present application; [Figure 5a] FIG. 2 is a schematic diagram of an abstract syntax tree according to an embodiment of the present application; [Figure 5b] FIG. 2 is a schematic diagram of another abstract syntax tree according to an embodiment of the present application; [Figure 6] 1 is a structural block diagram of a programming language analysis device according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0024] In order to make the technical solutions of the present application clearer for those skilled in the art, the technical solutions of the present application will be described below clearly and completely with reference to the drawings in the embodiments of the present application, and obviously, the described embodiments are only some of the embodiments of the present application, and not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without any creative efforts are all within the scope of protection of the present application.
[0025] In addition, the terms "first", "second", and the like in the specification and claims of this application and the drawings are used to distinguish between similar objects and are not necessarily used to describe a particular order or sequence. It is understood that the data used are interchangeable under appropriate circumstances, and therefore the embodiments of this application described herein may be performed in an order other than that shown or described herein. Furthermore, the terms "comprise" and "have" and their variants are intended to be non-exclusive, for example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to the steps or elements expressly recited, and may include other steps or elements that are not expressly recited or that are inherent to the process, method, product, or apparatus.
[0026] In accordance with an embodiment of the present application, an embodiment of a method for parsing a programming language is provided, and it should be understood that the steps illustrated in the flowcharts of the drawings may be performed, for example, in a computer system as a set of computer-executable commands, and that although a logical order is shown in the flowcharts, in some cases the steps may be performed in an order different from that shown or described.
[0027] 4 is a flow chart of a method for analyzing a programming language according to an embodiment of the present application. As shown in FIG. 4, the method includes the following steps:
[0028] Step S402: identifying the source code as a string of characters and parsing the string into a lexical unit list including a plurality of lexical units;
[0029] In this step, the source code is recognized and the source code is identified as a string. The lexical analyzer receives the string and parses the source program into a lexical unit list including a plurality of lexical units according to a set word construction rule.
[0030] In step S404, the plurality of lexical units are divided into first grouped lexical units which are lexical units including a polysemous symbol and second grouped lexical units which are lexical units not including a polysemous symbol,
[0031] When step S404 is executed, a classification process is performed on the lexical unit list to separate lexical units that include ambiguous codes from lexical units that do not include ambiguous codes.
[0032] In step S406, the first related lexical unit is converted into a second related lexical unit.
[0033] In step S408, an analysis is performed on the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units.
[0034] Through the above steps, a classification process is performed on the lexical unit list resulting from the lexical analysis, and ambiguous lexical units are converted into ambiguous lexical units, thereby achieving the objective of improving the interpreter's ability to process ambiguous code and achieving the technical effect of improving the accuracy with which the interpreter processes numerical computation programming languages.
[0035] According to one optional embodiment of the present application, dividing the multiple lexical units into the first and second similar lexical units in step S404 is achieved through the steps of obtaining token names of the multiple lexical units, identifying a target token name having ambiguity from the token names, identifying the lexical unit to which the target token name belongs as the first similar lexical unit, and identifying the lexical unit to which the token names other than the target token name belong as the second similar lexical unit.
[0036] In this step, we find symbols with polysemy according to the token names of lexical units, mark this type of lexical unit as the first type lexical unit, and mark other lexical units as the second type lexical unit.
[0037] According to another optional embodiment of the present application, performing step S406 of converting the first class lexical unit into the second class lexical unit includes inputting the first class lexical unit into a semantic analyzer for analysis to obtain the second class lexical unit.
[0038] Alternatively, the step of inputting the first synonymous lexical unit into a semantic analyzer for analysis to obtain the second synonymous lexical unit includes the steps of identifying a token name type of the first synonymous lexical unit based on context information of the first synonymous lexical unit, and modifying an attribute value of the first synonymous lexical unit based on the token name type of the first synonymous lexical unit to obtain the second synonymous lexical unit.
[0039] In this step, the semantic analyzer receives the first related lexical unit, determines a specific type of a word symbol of the first related lexical unit based on the context, modifies an attribute value of the first related lexical unit based on the determination result, and changes the type of the first related lexical unit to a second related lexical unit.
[0040] In some optional embodiments of the present application, performing step S408 of analyzing the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units includes inputting the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units to a syntactic analyzer for analysis, and inputting the analysis result of the syntactic parser on the second related lexical unit to a semantic analyzer for analysis.
[0041] In some optional embodiments of the present application, the step of inputting the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units into a parser for analysis includes the step of assembling the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units into a parse tree.
[0042] The parser receives the second class lexical unit, and assembles the lexical unit sequence into a parse tree according to the set grammar rules, using an adaptive LL(k) algorithm, where the first L in the LL indicates parsing the lexical unit sequence from left to right, the second L indicates using leftmost derivation in the parsing process, k≧1, and k indicates forward matching k lexical units in the matching process based on the grammar rules, and the adaptive LL(k) algorithm can perform analysis on syntax in a dynamic manner in the grammar parsing process, and can automatically rewrite left recursion in the grammar into an equivalent non-left recursive form.
[0043] According to one optional embodiment of the present application, the step of inputting the analysis result of the syntactic parser for the second class lexical unit to a semantic analyzer for analysis includes a step of performing a simplification process on the syntactic parse tree and constructing an abstract syntax tree.
[0044] The semantic analyzer receives the lexical analysis tree, the lexical unit sequence, and the symbol table information, and simplifies the syntax tree to construct an abstract syntax tree. The syntax analyzer outputs error information to the error processing module, and updates identifiers in the symbol table management module based on the results of the syntax analysis. The semantic analyzer outputs error information to the error processing module, and updates identifiers in the symbol table management module based on the results of the semantic analysis.
[0045] FIG. 5a is a schematic diagram of an abstract syntax tree according to an embodiment of the present application. As shown in FIG. 5a, a syntax tree corresponding to source code defining a simple matrix is provided, where L represents a list, R represents a row, J represents a matrix, and F represents a built-in function, all of which are placed in a user-defined symbol table.
[0046] The source code corresponding to the syntax tree shown in Figure 5a is a = [1, 2; 2, exp(2)].
[0047] FIG. 5b is a schematic diagram of another abstract syntax tree according to an embodiment of the present application. As shown in FIG. 5b, a syntax tree corresponding to one user-defined function sum source code is provided, where C denotes the user-defined function.
[0048] The source code corresponding to the syntax tree shown in Figure 5b is sum(2, 3).
[0049] According to another optional embodiment of the present application, when performing step S402, parsing the string into a lexical unit list is performed by parsing the string into a lexical unit list according to preset word construction rules, and each lexical unit in the lexical unit list includes a token name and an attribute value, where the token name is the lexical unit itself and the attribute value is a type of the lexical unit.
[0050] The parser receives a string and parses the source program into a list of lexical units based on the configured word formation rules. A lexical unit consists of a token name and an attribute value. The token name is the word itself and is used by the parser. The attribute value indicates the type of word and includes keywords, constants, operators, delimiters, and identifiers. Error information is output to the error processing module, and the identifier is input to the symbol management module.
[0051] The above method provided by the embodiments of the present application can solve the problem of ambiguous symbols in numerical calculation programming languages, and can also solve the problem of ambiguous symbols in other programming languages. A compiler based on this technical solution can be applied to numerical calculation programming languages such as Maltab and Octave.
[0052] FIG. 6 is a structural block diagram of a programming language analysis device according to an embodiment of the present application. As shown in FIG. 6, the device includes:
[0053] a first parsing module 60 arranged to identify the source code as a string of characters and to parse the string into a lexical unit list comprising a plurality of lexical units;
[0054] a classification module 62 configured to classify the plurality of lexical units into first class lexical units, which are lexical units including ambiguous symbols, and second class lexical units, which are lexical units not including ambiguous symbols;
[0055] a conversion module 64 arranged to convert the first class lexical units into second class lexical units;
[0056] and a second analysis module 66 configured to perform analysis on the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the multiple lexical units.
[0057] For a preferred embodiment of the embodiment shown in FIG. 6, reference can be made to the relevant description of the embodiment shown in FIG. 4, and the description will be omitted here.
[0058] An embodiment of the present application further provides a non-volatile storage medium containing a program stored thereon, the program, when executed, controlling a device in which the program resides to perform the above-described method of parsing a programming language.
[0059] The non-volatile storage medium is used to store a program that performs the following functions: identifying a source code as a string and parsing the string into a lexical unit list including a plurality of lexical units; dividing the plurality of lexical units into first synonymous lexical units, which are lexical units including a polysemous symbol, and second synonymous lexical units, which are lexical units not including a polysemous symbol; converting the first synonymous lexical units into second synonymous lexical units; and analyzing the second synonymous lexical units obtained by converting the first synonymous lexical units and the second synonymous lexical units obtained by classifying the plurality of lexical units.
[0060] An embodiment of the present application further provides a processor adapted to execute a program stored in the memory, the processor executing the above-mentioned method for parsing a programming language when the program is executed.
[0061] The processor is used to execute a program that performs the following functions: identifies source code as a string of characters, and parses the string into a lexical unit list including a plurality of lexical units; separates the plurality of lexical units into first synonymous lexical units, which are lexical units including a polysemous symbol, and second synonymous lexical units, which are lexical units not including a polysemous symbol; converts the first synonymous lexical units into second synonymous lexical units; and performs analysis on the second synonymous lexical units obtained by converting the first synonymous lexical units and the second synonymous lexical units obtained by classifying the plurality of lexical units.
[0062] The example numbers in the above application are merely for illustrative purposes and do not indicate superiority or inferiority of the examples.
[0063] In the above embodiments of the present application, the description of each embodiment focuses on specific points, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0064] It should be understood that in some embodiments provided by the present application, the technical contents disclosed may be realized in other ways. The embodiments of the devices described above are merely illustrative, for example, the division of the units is merely a division of logical functions, and may have other division methods when actually realized, for example, multiple units or assemblies may be combined or integrated into another system, or some features may be ignored or not implemented. In other respects, the illustrated or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections via interfaces, devices or modules, and may be electrical or other forms.
[0065] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., located in one place or distributed over multiple units, among which some or all units can be selected according to actual needs to achieve the objectives of the solution of the present embodiment.
[0066] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically independently, or two or more units may be integrated into one unit. The integrated unit may be realized in the form of hardware or in the form of a software functional unit.
[0067] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it may be stored in one computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present application or a part that contributes to the related technology or all or a part of the technical solution is embodied in the form of a software product, and the computer software product is stored in one storage medium and can include a plurality of commands to cause one computer device (which may be a personal computer, a server, a network device, etc.) to execute all or a part of the steps of the method described in each embodiment of the present application. The storage medium includes various media capable of storing program code, such as a USB memory, a read-only memory (ROM), a random access memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
[0068] The above is only a preferred embodiment of the present application, and it should be noted that those skilled in the art can make some further improvements and modifications without departing from the principles of the present application, and these improvements and modifications should also be considered as within the protection scope of the present application. [Industrial Applicability]
[0069] The solution provided by the embodiments of the present application can be applied to the software field, and the embodiments of the present application use the following steps to achieve the objective of improving the ability of an interpreter to process ambiguous code, and to realize the technical effect of improving the accuracy of the interpreter to process a numerical computation programming language: identifying a source code as a string, and parsing the string into a lexical unit list including a plurality of lexical units; dividing the plurality of lexical units into a first group of lexical units which are lexical units including ambiguous symbols and a second group of lexical units which are lexical units not including ambiguous symbols; converting the first group of lexical units into the second group of lexical units; and analyzing the second group of lexical units obtained by converting the first group of lexical units and the second group of lexical units obtained by classifying the plurality of lexical units.
Claims
1. identifying the source code as a string of characters and parsing the string into a lexical unit list comprising a plurality of lexical units; Dividing the plurality of lexical units into first related lexical units which are lexical units including a polysemous symbol and second related lexical units which are lexical units not including a polysemous symbol; converting the first synonymous lexical unit to the second synonymous lexical unit; performing an analysis on the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the plurality of lexical units.
2. The step of dividing the plurality of lexical units into a first related lexical unit and a second related lexical unit includes: obtaining token names for the plurality of lexical units; identifying an ambiguous target token name from the token names; identifying a lexical unit to which the target token name belongs as the first synonymous lexical unit, and identifying a lexical unit to which token names other than the target token name belong among the token names as the second synonymous lexical unit.
3. converting the first lexical unit into the second lexical unit includes inputting the first lexical unit into a semantic analyzer for analysis to obtain the second lexical unit; 2. The method of claim 1, wherein the step of analyzing the second synonymous lexical unit obtained by converting the first synonymous lexical unit and the second synonymous lexical unit obtained by classifying the plurality of lexical units comprises: a step of inputting the second synonymous lexical unit obtained by converting the first synonymous lexical unit and the second synonymous lexical unit obtained by classifying the plurality of lexical units to a syntactic analyzer to perform analysis; and a step of inputting an analysis result of the syntactic analyzer on the second synonymous lexical unit to the semantic analyzer to perform analysis.
4. The step of inputting the first synonymous lexical unit to a semantic analyzer for analysis to obtain the second synonymous lexical unit includes: determining a type of a token name of the first lexical unit based on context information of the first lexical unit; and modifying an attribute value of the first lexical unit based on a type of a token name of the first lexical unit to obtain the second lexical unit.
5. The step of inputting the second synonymous lexical unit obtained by converting the first synonymous lexical unit and the second synonymous lexical unit obtained by classifying the plurality of lexical units to a syntactic analyzer to perform analysis, 4. The method of claim 3, further comprising assembling the second related lexical unit obtained by converting the first related lexical unit and the second related lexical unit obtained by classifying the plurality of lexical units into a parse tree.
6. The step of inputting the analysis result of the syntactic analyzer for the second related vocabulary unit to the semantic analyzer for analysis includes:
6. The method of claim 5, further comprising the step of performing a simplification process on the parse tree to construct an abstract syntax tree.
7. The step of parsing the string into a list of lexical units comprises:
2. The method of claim 1, further comprising parsing the string into the lexical unit list according to predefined word construction rules, each lexical unit in the lexical unit list including a token name and an attribute value, the token name being the lexical unit itself and the attribute value being a type of the lexical unit.
8. a first parsing module configured to identify the source code as a string of characters and to parse the string into a lexical unit list including a plurality of lexical units; a classification module configured to classify the plurality of lexical units into first related lexical units, which are lexical units including ambiguous symbols, and second related lexical units, which are lexical units not including ambiguous symbols; a conversion module configured to convert the first synonymous lexical unit to the second synonymous lexical unit; a second analysis module configured to perform analysis on the second synonymous lexical unit obtained by converting the first synonymous lexical unit and the second synonymous lexical unit obtained by classifying the plurality of lexical units.
9. A non-volatile storage medium including a stored program, the non-volatile storage medium controlling an apparatus in which the program is located to execute the programming language analysis method according to any one of claims 1 to 7 when the program is executed.
10. A processor adapted to execute a program stored in a memory, the processor executing the method for analyzing a programming language according to any one of claims 1 to 7, when the program is executed.
Citation Information
Patent Citations
Purser preparing device corresponding to ambiguous grammar
JP1993241850A
System and method for recognizing structure in text
US20100088674A1
Method and device for managing ambiguities in the analysis of a source code
US20170024193A1
System and method for directly accessing SAS datasets from a JAVA program
US8943472B1
Parser generation
WO2015006075A1