Information processor and program
The information processing device facilitates source code analysis in business systems with multiple COBOL dialects by identifying language specifications and generating ASTs, enabling efficient compliance verification across different COBOL dialects.
Patent Information
- Application Number
- JP2023032116
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-12
AI Technical Summary
Business systems using COBOL with different language specifications become complex and difficult to maintain due to varying dialects, making source code analysis time-consuming and inefficient.
An information processing device that acquires source code, identifies the programming language, generates a syntax model using appropriate generators, and applies coding rules to analyze and verify compliance, allowing for easy analysis across multiple COBOL dialects.
Enables efficient analysis of source code written in multiple COBOL dialects by converting it into an abstract syntax tree (AST) and applying unified coding rules, reducing the need for separate rules for each dialect.
Smart Images

Figure 2024124145000001
Abstract
Description
[Technical field]
[0001] The present invention relates to an information processing device and a program. [Background technology]
[0002] Business systems used in the operations of companies, local governments, etc. use software of various sizes. The source code of the software used in business systems can sometimes reach hundreds of thousands or even millions of lines. Business systems require maintenance, such as inspection and correction of source code, and modification to add functions, in order to maintain the activities of the company or to grow and strengthen its competitiveness in the future. However, some business systems have become complex and black boxes, making maintenance and modification difficult in many cases.
[0003] Tools for analyzing source code are provided to improve the productivity of source code maintenance work and function addition. By using a tool for analyzing source code, it is possible to verify whether or not predetermined coding rules are being observed. In addition, a technology has been proposed that makes it easier to utilize analysis tools and coding rules owned by converting source code written in a predetermined language, COBOL (Common Business Oriented Language), into another COBOL language via an Abstract Syntax Tree (AST) (Patent Document 1, Patent Document 2). [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2010-140407 A [Patent Document 2] JP 2010-140408 A Summary of the Invention [Problem to be solved by the invention]
[0005] However, COBOL has differences in language specifications (also called dialects) between vendors, such as MF COBOL, Net COBOL, and Hitachi COBOL, and the COBOL assets of business systems around the world are written in multiple COBOLs. When maintaining large-scale, complex business systems, it can be time-consuming to understand the COBOL language specifications and analyze the source code.
[0006] The present invention has been made in consideration of the above-mentioned problems, and its object is to realize a technology that can facilitate analysis of source code when a system contains source code written in multiple programming languages with different language specifications. [Means for solving the problem]
[0007] In order to solve this problem, for example, an information processing device of the present invention has the following arrangement. An acquisition means for acquiring source code written in a programming language; an identification means for identifying in which programming language the acquired source code is written; and a syntax model generation means for outputting the predetermined syntax model generated by using a generator corresponding to the identified programming language out of a plurality of generators that generate a predetermined syntax model from source code written in different programming languages. Effect of the Invention
[0008] According to the present invention, when a system includes source codes written in a plurality of programming languages having different language specifications, it is possible to easily analyze the source codes. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram illustrating an overview of an information processing system according to an embodiment of the present invention. [Diagram 2]FIG. 1 is a block diagram showing an example of a functional configuration of an information processing device according to an embodiment of the present invention; [Diagram 3] FIG. 2 is a block diagram showing an example of the functional configuration of a communication device according to the embodiment; [Figure 4] FIG. 2 is a block diagram showing an example of the functional configuration of a data management device according to the present embodiment; [Diagram 5] A flowchart showing a series of operations in the code analysis process according to the present embodiment. [Figure 6] A flowchart showing a series of operations in a syntax model generation process according to the present embodiment. [Figure 7] FIG. 13 is a diagram showing an example of a screen for setting source code to be analyzed according to the present embodiment; [Figure 8] A flowchart showing a series of operations in another syntax model generation process according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the invention according to the claims, and not all combinations of features described in the embodiments are essential to the invention. Two or more features among the multiple features described in the embodiments may be arbitrarily combined. In addition, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0011] <Outline of information processing system> FIG. 1 shows an overview of an information processing system according to the present embodiment. The information processing system 10 according to the present embodiment includes an information processing device 100 which is an information processing server as an example, a communication device 110 which is a personal computer as an example, and a data management device 120 which is a database server as an example. In the description of the present embodiment, the data management device 120 and the information processing device 100 are configured separately, but the data management device 120 may be incorporated inside the information processing device 100. In the description of the present embodiment, the information processing device 100 and the data management device 120 are physical devices, but at least one of these devices may be realized as a virtual machine executed on one or more computers in a data center.
[0012] The data management device 120 stores the source code of the software used in the business system (for example, in a source code repository). For example, the source code stored in the data management device 120 may be source code developed in the communication device 110 and checked in.
[0013] The source code is written in, for example, the programming language COBOL. COBOL includes differences (dialects) in the language specifications of each vendor, such as MF COBOL, Net COBOL, and Hitachi COBOL. In this embodiment, the source code stored in the data management device 120 and written in COBOL includes source code written in languages with different language specifications. Note that COBOLs with different language specifications (for example, MF COBOL and Hitachi COBOL) may not be mixed in source code developed in the same development unit. For example, one language specification (for example, Hitachi COBOL) may be used in source code developed in the same project or in one subsystem. On the other hand, for example, COBOLs with different language specifications may be used in source code developed in a parent project and source code developed in a child project. Also, for example, in source code for one product used in a business system, if the product versions are different, COBOLs with different language specifications may be used. Also, for example, COBOLs with different language specifications may be used in different subsystems constituting the product.
[0014] These different language specifications of COBOL have differences in specifications such as different reserved words and the position where reserved words are written, even though they are the same function call processing. For example, the CALL interface is written as "CALL function name (newline) USING ..." in one language specification, while it is written as "CALL (newline) specific description (newline) function name USING ..." in another language specification.
[0015] The information processing device 100 can acquire source code stored in the data management device 120, analyze the quality of the source code, and provide the analysis result to the communication device 110 as a software metrics measurement result. The analysis of the source code includes, for example, verifying whether the source code violates a predetermined rule. The predetermined rule is, for example, a coding rule that is determined for each predetermined unit such as each project or each subsystem. The predetermined rule is stored in the information processing device 100 in, for example, a predetermined known format (such as text or script). The software metrics measurement result may include various quantitative evaluation results regarding the source code to be analyzed. The software metrics measurement result may include, for example, information regarding the scale, complexity, and maintainability of the source code to be analyzed. In addition, the software metrics measurement result according to this embodiment may include information regarding the identified COBOL language specification, and, when different language specifications exist, information regarding the scale, complexity, and maintainability of each language specification in a distinguishable manner. The software metrics measurement results may also include analysis results for predetermined rules, such as the number of locations determined to have violated coding rules, and a breakdown of the violated coding rules. These analysis results may be classified for each identified COBOL language specification. In addition, the software metrics measurement results may also include results of static analysis and dynamic analysis of other source codes.
[0016] The information processing device 100 performs a syntax model generation process to analyze the quality of the source code. The syntax model generation process will be described in detail later, but the information processing device 100 analyzes source code written in each COBOL language specification and converts it into an abstract syntax tree (AST). By converting source code written in each COBOL language specification into an AST, it is possible to perform rule determination using the AST. In other words, by performing rule determination on the AST, it becomes unnecessary to create or execute rules for each language specification for parts that have common specifications, even for different language specifications, and it becomes possible to more easily perform rule determination on the source code (however, individual rules must be created for parts that have differences or unique characteristics depending on the language specifications).
[0017] The communication device 110 is, for example, a device used by a user who develops software for a business system. When the user creates source code for a program, the communication device 110 transmits the source code to the data management device 120 via a network. The communication device 110 also performs settings for the information processing device 100 to execute analysis of the source code, receives the results of the analysis of the source code by the information processing device 100, and presents the results to the user.
[0018] <Configuration of information processing device> Next, a functional configuration example of the information processing device 100 will be described with reference to Fig. 2. Each of the functional blocks described with reference to the figure may be integrated or separated, and the functions described may be realized by another block. Also, what is described as hardware may be realized by software, and vice versa. Furthermore, in this embodiment, the information processing device 100 is described as a single device, but the information processing device 100 may be composed of multiple devices.
[0019] The communication unit 201 includes a communication circuit or a communication module that communicates with the communication device 110 and the data management device 120 used by the user via a network.
[0020] The control unit 202 includes a CPU 210, which is a central processing unit, and a RAM 211. The CPU 210 may be configured with one or more processors. The control unit 202 executes a computer program stored in the recording unit 204 to perform a code analysis process and a syntax model generation process, which will be described later, and controls the operation of each unit of the information processing device 100.
[0021] The RAM 211 is a volatile storage medium such as a DRAM, and temporarily stores parameters and processing results for the control unit 202 to execute a computer program.
[0022] The power supply unit 203 is a circuit or module for providing power for operating each unit of the information processing device 100. The recording unit 204 includes a non-volatile recording medium such as a hard disk or a semiconductor memory, and records setting values and calculation results required for the operation of the information processing device 100. The recording unit 204 may include a database therein. The database includes coding rules 220 for verifying whether the source code complies with predetermined coding rules or does not include inappropriate descriptions in the programming language.
[0023] In the coding rules 220, predefined rules are defined for each predetermined unit, such as for each project or subsystem. Rules for descriptions declaring variables include, for example, (rule 1) that int type variable names start with the letter "i", (rule 2) that when declaring variables, multiple variables should not be declared (defined) in one type declaration, and (rule 3) that variable names must be four characters or more. For example, COBOL source code declaring "int num" does not satisfy the above (rule 1) and (rule 3) because the variable name starts with the letter "n" and is composed of three characters. On the other hand, the source code defines one variable, so it satisfies the above (rule 2).
[0024] The source code acquisition unit 212 acquires the source code of the analysis target from the data management device 120 according to the analysis target specified by the user on the communication device 110, for example.
[0025] The syntax model generation unit 213 analyzes source code written in each language specification of COBOL and converts it into an AST (syntax model). The syntax model generation unit 213 converts COBOL source code into an AST using a plurality of AST generators that convert each of a plurality of COBOL language specifications into an AST. The AST is formed as a tree structure in which nodes correspond to components of the source code, such as operators and their operands. The AST generator can generate an AST using a known method adopted in general compilers and interpreters, such as performing lexical analysis and syntax analysis of the source code. The AST converted from COBOL may be, for example, the one described in JP 2010-140407 A.
[0026] The language identification unit 214 identifies in which programming language the acquired source code is written. The language identification unit 214 identifies the programming language of the acquired source code based on the result of applying multiple generators to the source code acquired by the source code acquisition unit 212.
[0027] The rule verification unit 215 verifies whether or not a predetermined coding rule is observed by applying the coding rule stored in the recording unit 204 to the generated syntax model (AST). The metrics generation unit 216 generates software metrics measurement results based on the verification results of the rule verification unit 215 or based on other software metrics, and transmits the results to the communication device 110.
[0028] When rule verification unit 215 detects source code that does not satisfy the coding rules, violation result control unit 217 records information about the source code in recording unit 204. For example, violation result control unit 217 associates the part of the code that does not satisfy the coding rules, the file name of the source code, and the rule identification information of the coding rule in recording unit 204. Violation result control unit 217 may notify communication device 110 of the recorded information, or may send it to a preregistered email address.
[0029] <Communication device configuration> Next, a functional configuration example of the communication device 110 will be described with reference to FIG. 3. In this embodiment, a personal computer is used as an example of the communication device, but the communication device may be other electronic devices such as a tablet terminal. Each of the functional blocks described with reference to the following figures may be integrated or separated, and the functions described may be realized by another block. Also, what is described as hardware may be realized by software, and vice versa.
[0030] The communication unit 301 includes, for example, a communication circuit, and communicates with the information processing device 100 or the data management device 120 by connecting to the Internet via mobile communication such as LTE, or connecting to a network via wireless LAN communication.
[0031] The control unit 302 includes a CPU 310 and a RAM 311, and controls the operation of each unit in the communication device 110 by the CPU 310 executing a computer program recorded in the recording unit 307, for example.
[0032] The operation unit 303 includes a touch panel, a keyboard, and the like provided in the communication device 110, and can perform operations on GUIs for various operations displayed on the display unit 306. The power supply unit 304 provides power to each unit of the communication device 110.
[0033] The display unit 306 includes a display device such as an LCD, an OLED, etc. In response to an instruction from the control unit 302, the display unit 306 displays a GUI for specifying the source code to be analyzed, a GUI for displaying the software metrics measurement results, a GUI for displaying the violation results including information on the source code that does not satisfy the coding rules, and the like.
[0034] The recording unit 307 includes a non-volatile memory such as a semiconductor memory, and holds programs and setting values executed by the control unit 302. The computer programs held in the recording unit 307 include an operating system for implementing various functions of the communication device 110, and various applications such as a browser for displaying information received from the information processing device 100.
[0035] <Data management device configuration> Next, a functional configuration example of the data management device 120 will be described with reference to Fig. 4. Each of the functional blocks described with reference to the figure may be integrated or separated, and the functions described may be realized by another block. Also, what is described as hardware may be realized by software, and vice versa. Furthermore, in this embodiment, an example is described in which the data management device 120 is a single device, but the data management device 120 may be composed of multiple devices or may be composed of a virtual machine.
[0036] The communication unit 401 includes, for example, a communication circuit and the like, and communicates with the information processing device 100 or the communication device 110 by connecting to the Internet via mobile communication such as LTE, or connecting to a network via wireless LAN communication.
[0037] The control unit 402 includes a CPU 410 and a RAM 411, and controls the operation of each unit in the data management device 120 by the CPU 410 executing a computer program recorded in the recording unit 404, for example.
[0038] The power supply unit 403 provides power to each unit of the data management device 120. The recording unit 404 includes a non-volatile recording medium, and stores, for example, a source code repository 420 and various computer programs. The repository 420 records source code developed for a business system, classifying it according to various viewpoints such as product, project, version, and subsystem.
[0039] Next, a series of operations of the code analysis process executed in the information processing device 100 will be described with reference to FIG. 5. This process is realized by the CPU 210 of the control unit 202 executing a computer program recorded in the recording unit 204. This process is started in response to receiving a designation of a source code to be processed from the communication device 110. The designation of the source code to be processed may be specified, for example, on a source code analysis setting screen 701 displayed on the display unit 306 of the communication device 110 as shown in FIG. 7. The source code analysis setting screen 701 shows an example in which, for example, a source code and a coding rule can be selected, but is not limited to this example. The source code and the coding rule may be selected in other formats, or other items may be selected. In the source code selection field of the source code analysis setting screen 701, a folder 702 of subsystem A and a folder 703 of subsystem B are displayed. In the example shown in FIG. 7, the folder 703 of subsystem B is selected, and the subordinate information is displayed. In the folder of the subsystem, functional modules 704 (e.g., functional module A, functional module B, and functional module C) are arranged in a lower layer. In the example shown in FIG. 7, functional module C is selected and the lower information is displayed. In the lower layer of the functional module, source code 705 belonging to the functional module is displayed. In the example shown in FIG. 7, in a state where information of several layers is displayed, the user uses a cursor 706 to specify source code of functional module B and functional module C as source code to be analyzed. In the example of FIG. 7, the user may further select a coding rule to be used for analyzing the source code from coding rules 707. The coding rule 707 may be acquired from the coding rules 220 stored in the information processing device 100. When an analysis start button 708 is pressed, the communication device 110 transmits information of the source code to be processed and the coding rule to the information processing device 100.For example, the communication device 110 transmits information indicating the source code selected by the user (the source codes of the functional modules B and C of the subsystem B) to the information processing device 100 as the source code to be processed.
[0040] In S501, the source code acquisition unit 212 acquires source code to be processed. For example, the source code acquisition unit 212 acquires the source code to be processed from the data management device 120 based on information of the source code received from the communication device 110. For example, in the example shown in Fig. 7, the source code acquisition unit 212 sequentially acquires the source code to be processed from a predetermined number of source codes constituting the business system.
[0041] In S502, the syntax model generation unit 213 analyzes the source code and generates a syntax model (i.e., an AST). Details of the process will be described later with reference to FIG.
[0042] In S503, the rule verification unit 215 verifies whether the source code satisfies the rules by using the generated syntax model (i.e., the AST). For example, the rule verification unit 215 determines whether the AST corresponding to the COBOL source code in which "int num" is declared satisfies the coding rules.
[0043] In S504, if the rule verification unit 215 determines using the AST that the source code satisfies the coding rules, the process proceeds to S506, and if not, the process proceeds to S505.
[0044] In S505, the violation result control unit 217 records information about the source code that is determined not to satisfy the coding rule in the recording unit 204. As described above, the violation result control unit 217 records, for example, the part of the code that does not satisfy the coding rule, the file name of the source code, and the rule identification information of the coding rule in association with each other in the recording unit 204, and notifies the communication device 110 of the recorded information.
[0045] In S506, the control unit 202 determines whether all of the source code to be processed has been processed. If the control unit 202 determines that all of the source code to be processed has been processed, the process proceeds to S507, and if not, the process returns to S502.
[0046] In S507, the metrics generating unit 216 generates software metrics measurement results and transmits them to the communication device 110. As described above, the software metrics measurement results may include analysis results for predetermined rules, such as the number of locations determined to have violated a specified coding rule, and a breakdown of the violated coding rules. The analysis results may be classified for each identified COBOL language specification. In addition, the software metrics measurement results may include results of static analysis and dynamic analysis of other source codes.
[0047] In this way, in this embodiment, a syntax model (AST) is generated from COBOL source code, and then it is determined whether the coding rules are satisfied. In this way, even if the COBOL source code is written in multiple language specifications, there is no need to prepare coding rules for each language specification. In other words, by using coding rules for verifying the AST, it becomes possible to easily analyze the COBOL source code.
[0048] <Operation of Syntax Model Generation Processing in Information Processing Device> Next, the operation of the syntax model generation process will be described with reference to Fig. 6. This process is realized by the CPU 210 of the control unit 202 executing a computer program recorded in the recording unit 204. This process is started in response to the execution of the process of S502 described above. In the following description, as an example, a case will be described in which an AST generator (called a parser) for MF COBOL, a parser for Net COBOL, and a parser for Hitachi COBOL are used, but this example is not limiting and other parsers may be used.
[0049] In S601, the syntax model generation unit 213 determines one or more parsers to be applied to the source code from among a plurality of COBOL parsers. For example, the syntax model generation unit 213 determines, for example, three parsers from among a parser for MF COBOL, a parser for Net COBOL, and a parser for Hitachi COBOL as parsers to be applied to the source code. If a specific parser (for example, MF COBOL) is excluded in S604 described later, the syntax model generation unit 213 determines the parsers to be applied to the source code as the parser for Net COBOL and the parser for Hitachi COBOL.
[0050] In S602, the syntax model generation unit 213 applies the determined parser to the COBOL source code to analyze the source code and generate a syntax model (AST). For example, the parser performs lexical analysis, syntax analysis, etc. of the source code and then generates a syntax model. If the parser is for MF COBOL, a syntax model can be generated normally from source code including the MF COBOL language specification. However, if an attempt is made to generate a syntax model using the MF COBOL parser from source code including a description different from the MF COBOL language specification, an error occurs.
[0051] If three parsers (e.g., parsers for MF COBOL, Net COBOL, and Hitachi COBOL) are determined in S601, the syntax model generation unit 213 applies each parser to one source code and attempts to generate three syntax models. If a parser is excluded in S604 (described later), the syntax model generation unit 213 attempts to generate a syntax model using the remaining parsers that are not excluded.
[0052] For example, when it is assumed that a single language specification is used in a subsystem, the syntax model generation unit 213 can prevent the excluded parser from being used continuously when analyzing source codes of different functional modules in the subsystem. For example, in the example shown in FIG. 7, consider a case where the source code group to be processed is the source code of functional modules B and C in subsystem B. Assume that the source code included in functional module B is analyzed first, and then the source code included in functional module C is analyzed. In this case, if the syntax model generation unit 213 excludes a specific parser (e.g., a parser for Hitachi COBOL) when analyzing the source code of functional module B to generate a syntax model, the syntax model generation unit 213 also attempts to generate a syntax model using the remaining parsers excluding the parser for Hitachi COBOL when analyzing the subsequent processing target (i.e., functional module C). In addition, when the number of parsers is narrowed down to one, the syntax model generation unit 213 can limit the parser to be applied to subsequent source codes to one. In this way, the number of parsers to be applied to a large number of source codes can be reduced, thereby reducing the processing load.
[0053] In S603, the syntax model generation unit 213 determines whether an error has occurred when generating a syntax model from the COBOL source code. If an error has occurred when generating a syntax model from the COBOL source code to be processed, the syntax model generation unit 213 advances the process to S604, and if not, advances the process to S605.
[0054] In S604, the syntax model generation unit 213 excludes the parser in which the error occurred when generating the syntax model from the one or more parsers determined in S601.
[0055] In S605, the syntax model generation unit 213 judges whether the process of generating syntax models has been performed for all source codes to be processed. If the syntax model generation unit 213 judges that the process has been performed for all source codes to be processed, the process proceeds to S606, otherwise the process returns to S601.
[0056] In S606, the language identification unit 214 identifies the COBOL language of the source code to be processed based on the parser that was not excluded in S604. For example, the language identification unit 214 identifies the source code as Hitachi COBOL if the Hitachi COBOL parser is not excluded among the MF COBOL parser, the Net COBOL parser, and the Hitachi COBOL parser. This example corresponds to a case where an error occurs in an incompatible parser (because the syntax model cannot be generated) when an attempt is made to generate a syntax model from source code written in Hitachi COBOL using the MF COBOL parser, the Net COBOL parser, and the Hitachi COBOL parser. The language identification unit 214 identifies the language specification of the source code as Hitachi COBOL by the Hitachi COBOL parser that is not excluded.
[0057] In S607, the syntax model generation unit 213 outputs a syntax model generated by applying a parser that has not been excluded to the source code. For example, the syntax model generation unit 213 outputs a syntax model generated from the identified Hitachi COBOL source code. If there is a syntax model generated by a parser that has not been identified, the syntax model generation unit 213 may delete that syntax model. After outputting the generated syntax model, the syntax model generation unit 213 returns to the original process.
[0058] In the above embodiment, the syntax model generation process applies multiple parsers to the acquired source code, and identifies a parser suitable for the language specification of the source code based on the results of applying the parsers. Then, the identified parser (e.g., a Hitachi COBOL parser) is applied to the source code to generate a syntax model, which is output. In this way, even if there is a source code group in which source code written in COBOL with various language specifications may exist, it is possible to easily analyze the source code.
[0059] In the above embodiment, the COBOL language is identified based on the result of generating the syntax model. However, the operation of the syntax model generation process is not limited to this and may be executed in other ways. In other embodiments, the operation of the syntax model generation process may be the operation shown in FIG. 8. The operation of the syntax model generation process shown in FIG. 8 is realized by the CPU 210 of the control unit 202 executing a computer program recorded in the recording unit 204. This process is started in response to the execution of the above-mentioned process of S502. In the following description, as an example, a case in which a learning model is used to identify whether a source code is MF COBOL, Net COBOL, or Hitachi COBOL will be described, but this example is not limited to this example and other language specifications may be identified.
[0060] In S801, the language identification unit 214 identifies the COBOL language of the source code using a trained learning model. The learning model is, for example, a machine learning model trained to identify which programming language is written in. The learning model is, for example, a deep neural network trained using teacher data that is a set of source code written in a specific language specification and information indicating the language specification of the source code. The learning model takes the source code as input and outputs the probability that the input source code is written in each COBOL language. When the output probability is the highest and is equal to or greater than a predetermined threshold, the language identification unit 214 identifies the source code as being in a specific COBOL language and outputs the identification result.
[0061] In S802, the syntax model generation unit 213 applies the parser of the COBOL language identified in S801 to the source code to generate a syntax model. The syntax model generation unit 213 outputs the generated syntax model.
[0062] In this manner, in the above embodiment, the COBOL language of the source code is identified using the trained learning model, and a syntax model is generated using a parser corresponding to the identified language. Even in this manner, even if there is a source code group in which source code written in COBOL with various language specifications may exist, it is possible to easily analyze the source code.
[0063] As described above, in the above embodiment, source code written in a programming language is acquired, and the programming language in which the acquired source code is written is identified. Then, among a plurality of generators that generate predetermined syntax models from source code written in different programming languages, a syntax model generated using a generator corresponding to the identified programming language is output. In this way, when a business system includes source code written in a plurality of programming languages with different language specifications, it is possible to easily analyze the source code.
[0064] The invention is not limited to the above-described embodiment, and various modifications and variations are possible within the scope of the gist of the invention. [Explanation of symbols]
[0065] 100: information processing device, 110: communication device, 120: data management device, 202: control unit, 212: source code acquisition unit, 213: syntax model generation unit, 214: language identification unit, 215: rule verification unit, 216: metrics generation unit
Claims
1. An acquisition means for acquiring source code written in a programming language; an identification means for identifying in which programming language the acquired source code is written; and a syntax model generation means for outputting the predetermined syntax model generated by using a generator corresponding to the identified programming language among a plurality of generators that generate a predetermined syntax model from source code written in different programming languages.
2. The information processing apparatus according to claim 1 , wherein the identification means identifies a programming language of the acquired source code based on a result of applying the plurality of generators to the acquired source code.
3. The information processing device according to claim 1 , wherein the identification means identifies the programming language of the acquired source code by using a machine learning model trained to identify in which programming language the source code is written.
4. the acquiring means successively acquires source codes from a first number of source codes constituting a subsystem of the business system; 3. The information processing device according to claim 2, wherein the identification means identifies the programming language by excluding generators that cannot generate the predetermined syntax model when the generators are applied to the source code acquired sequentially.
5. 2. The information processing apparatus according to claim 1, wherein the different programming languages are languages having different language specifications in COBOL, and the predetermined syntax model is an AST (Abstract Syntax Tree).
6. A program for causing a computer to function as each of the means of the information processing device according to any one of claims 1 to 5.
Citation Information
Patent Citations
Source code inspection device
JP2010140407A
Source code converting device
JP2010140408A
