KR20180115921A - Conversion method of programming language - Google Patents

Conversion method of programming language Download PDF

Info

Publication number
KR20180115921A
KR20180115921A KR1020170048412A KR20170048412A KR20180115921A KR 20180115921 A KR20180115921 A KR 20180115921A KR 1020170048412 A KR1020170048412 A KR 1020170048412A KR 20170048412 A KR20170048412 A KR 20170048412A KR 20180115921 A KR20180115921 A KR 20180115921A
Authority
KR
South Korea
Prior art keywords
node
line
list
bidirectional
bidirectional list
Prior art date
Application number
KR1020170048412A
Other languages
Korean (ko)
Other versions
KR101952328B1 (en
Inventor
박태영
Original Assignee
박태영
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 박태영 filed Critical 박태영
Priority to KR1020170048412A priority Critical patent/KR101952328B1/en
Publication of KR20180115921A publication Critical patent/KR20180115921A/en
Application granted granted Critical
Publication of KR101952328B1 publication Critical patent/KR101952328B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present invention relates to a conversion method of a programming language. The present invention includes: a syntax analysis step of analyzing a source code and generating an abstract syntax tree and a bidirectional list, respectively; a tree reconstruction step of modifying the bidirectional list while searching for the abstract syntax tree; and a code generation step of generating a new code from the modified bidirectional list. It is possible to save the development time and efforts of a developer.

Description

프로그래밍 언어간 변환 방법{CONVERSION METHOD OF PROGRAMMING LANGUAGE}{CONVERSION METHOD OF PROGRAMMING LANGUAGE}

본 발명은 프로그래밍 언어간 변환 방법에 관한 발명으로, 보다 상세하게는 특정 프로그래밍 언어에서 다른 프로그래밍 언어로 변환할 때 프로그래밍 언어의 틀을 유지하면서 변환할 수 있는 프로그래밍 언어간 변환 방법에 관한 것이다.The present invention relates to a method of converting between programming languages, and more particularly, to a method of converting between programming languages that can be converted while maintaining a framework of a programming language when converting from one programming language to another.

오늘날 프로그래밍 언어는 계속적으로 발전하고 있으며 많은 신규 언어들이 생겨나고 있는데, 각 언어마다 표현의 방식이 조금씩 차이가 나지만 컴파일 과정을 거쳐 실행되는 프로그램의 동작 구조 자체는 변하지 않는다.Today, the programming language continues to evolve, and many new languages are emerging. The programming style of the program that runs through the compilation process itself does not change, although each language has a slightly different representation.

이러한 신규 언어들은 기존의 언어들의 문법을 개선하여 발전하고 있으며 새로운 문법 체계들을 적용하고 있다. 즉, 신규 언어들의 문법은 기존 언어들의 문법 체계를 포함한다고 할 수 있다.These new languages are improving by improving the grammar of existing languages and applying new grammar systems. In other words, the grammar of new languages includes the grammar of existing languages.

예를 들어 C# 이란 언어는 C++, Java 들의 문법 체계를 포함할 뿐만 아니라 C# 고유의 문법 체계를 포함하고 있고, 또한 ECMAScript(JavaScript)는 기존의 언어들과 다른 Template Literal 이라는 고유한 문법을 가지고 있으며, 아울러, 데이타베이스에서 사용되는 Stored Procedure는 오래 전 문법을 아직도 사용하고 있다.For example, C # includes not only the grammar of C ++, but also the grammar of C #, and ECMAScript (JavaScript) has a unique grammar called Template Literal, which is different from existing languages, In addition, the stored procedure used in the database is still using the old grammar.

소프트웨어 산업에서 기존 언어로 작성된 소스를 신규 언어로 새로 작성해야 하는 일들은 비일비재하다.In the software industry, the need to create a new language in a language written in an existing language is inevitable.

에디터의 발전으로 기존 소스에서 상위 언어로 수정하는 일은 수월해진 면은 있지만, 문법 체계를 고려하여 수정되지 않기 때문에 정확성이 떨어진다. 따라서, 에디터의 도움으로 수정한 후에도 수동으로 하나하나 검토해야 하는 문제점이 있다.The development of the editor makes it easier to modify from the old source to the higher language, but it is less accurate because it is not modified considering the grammar system. Therefore, there is a problem that it is necessary to review each manual manually after editing with the help of an editor.

이에 본 출원인은 하나의 프로그래밍 언어에서 다른 언어로 변환할 때 틀을 유지하면서 변환할 수 있는 프로그래밍 언어간 변환 방법을 발명하였다.Thus, Applicant has invented a conversion method between programming languages that can be converted while maintaining a frame when converting from one programming language to another.

대한민국 공개특허공보 제10-2010-0057495호(2010.05.31.)Korean Patent Publication No. 10-2010-0057495 (May 31, 2010)

본 발명은 상기한 바와 같은 문제를 해결하기 위해 발명된 것으로, 소스 코드의 문법체계를 고려하여 소스 코드의 주석 및 틀을 유지하면서 신규 언어로 변환함으로써 신규 언어의 정확성을 향상시키고, 또한 신규 언어에 대한 개발자의 개발 시간과 노력을 절약할 수 있는 프로그래밍 언어간 변환 방법을 제공하는데 그 목적이 있다.SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to improve the accuracy of a new language by converting a new language while maintaining the annotation and frame of the source code in consideration of the grammar system of the source code, The purpose of this paper is to provide a conversion method between programming languages that can save developers time and effort.

상기한 바와 같은 목적을 달성하기 위한 본 발명에 따른 프로그래밍 언어간 변환 방법은 소스 코드를 분석하여 추상 구문 트리와 양방향 리스트를 각각 생성하는 구문 분석 단계; 상기 추상 구문 트리를 탐색하면서 상기 양방향 리스트를 수정하는 트리 재구성 단계; 및 수정된 상기 양방향 리스트로부터 신규 코드를 생성하는 코드 생성 단계;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided a method of converting between programming languages, the method comprising: a syntax analysis step of analyzing source code to generate an abstract syntax tree and a bidirectional list; A tree reconstruction step of modifying the bidirectional list while searching the abstract syntax tree; And a code generation step of generating a new code from the modified bi-directional list.

또한, 상기 구문 분석 단계는, 상기 소스 코드로부터 개별 요소를 분해하여 복수의 토큰을 생성하는 토큰 생성 공정; 상기 토큰을 표현 노드 또는 단말 노드로 변환하여 상기 추상 구문 트리를 생성하는 추상 구문 트리 생성 공정; 및 상기 단말 노드를 연결하여 상기 양방향 리스트를 생성하는 양방향 리스트 생성 공정;을 포함할 수 있다.The parsing step may include: a token generating step of generating a plurality of tokens by decomposing individual elements from the source code; An abstract syntax tree generating step of converting the token into a presentation node or a terminal node to generate the abstract syntax tree; And a bidirectional list generation step of generating the bidirectional list by connecting the terminal node.

또한, 상기 토큰 생성 공정은, 상기 소스 코드의 주석을 상기 토큰에 저장할 수 있다.Further, the token generation step may store an annotation of the source code in the token.

또한, 상기 추상 구문 트리 생성 공정은, 상기 표현 노드의 속성으로 시작 노드 및 종료 노드를 저장할 수 있다.Also, the abstract syntax tree generation process may store the start node and the end node as attributes of the expression node.

또한, 상기 추상 구문 트리 생성 공정은, 상기 단말 노드의 속성으로 시작 컬럼, 시작 라인, 종료 컬럼 및 종료 라인을 저장할 수 있다.In addition, the abstract syntax tree generation process may store a start column, a start line, an end column, and an end line as attributes of the terminal node.

또한, 상기 양방향 리스트 생성 공정은, 상기 토큰에 주석이 저장된 경우, 상기 토큰으로부터 주석을 추출하여 상기 양방향 리스트에 주석 노드를 포함시킬 수 있다.In addition, the bidirectional list generation process may include an annotation node in the bidirectional list by extracting an annotation from the token when the annotation is stored in the token.

또한, 상기 트리 재구성 단계는, 상기 양방향 리스트에 노드를 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 노드 재구성 공정; 상기 양방향 리스트에 표현을 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 표현 재구성 공정; 및 상기 양방향 리스트의 노드 값을 치환하여 상기 양방향 리스트를 수정하는 노드 값 치환 공정;을 포함할 수 있다.Also, the tree reconstruction step may include: a node reconstruction step of modifying the bidirectional list by inserting or deleting nodes in the bidirectional list; A representation reconstruction process for modifying the bi-directional list by inserting or deleting a representation in the bi-directional list; And a node value replacement step of updating the bidirectional list by replacing the node value of the bidirectional list.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에 노드 삽입시, 삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드인 경우, 상기 다음 노드의 라인을 증가시킬 수 있다.The node reconfiguration process may further include a step of, when a node is inserted into the bidirectional list, when a difference between an insertion node and a line of a previous node or a difference between a next node and a line of the insertion node is greater than 0, The line of the next node can be increased.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에 노드 삽입시, 삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드가 아닌 경우, 상기 다음 노드와 삽입 노드의 라인이 동일한 경우 상기 다음 노드의 컬럼을 상기 삽입 노드의 길이만큼 증가시킬 수 있다.Also, the node reconstruction process may include: when a node is inserted into the bidirectional list, a difference between an insertion node and a line of a previous node or a difference between a next node and a line of the insertion node is greater than 0, If the next node and the insertion node have the same line, the column of the next node may be increased by the length of the insertion node.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에 노드 삽입시, 삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드가 아닌 경우, 상기 이전 노드와 삽입 노드의 라인이 동일하지 않는 경우 상기 다음 노드의 라인을 증가시킬 수 있다.Also, the node reconstruction process may include: when a node is inserted into the bidirectional list, a difference between an insertion node and a line of a previous node or a difference between a next node and a line of the insertion node is greater than 0, If the lines of the previous node and the insertion node are not the same, the line of the next node may be increased.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에 노드 삭제시, 다음 노드와 삭제 노드의 라인이 동일한 경우, 상기 다음 노드의 컬럼을 상기 삭제 노드의 길이만큼 감소시킬 수 있다.Also, the node reconstruction process may reduce the column of the next node by the length of the deletion node when the next node and the deletion node are the same when deleting the node in the bidirectional list.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에서 노드 삭제시, 다음 노드와 삭제 노드의 라인이 동일하지 않고, 상기 삭제 노드와 이전 노드의 라인이 동일한 경우, 상기 삭제 노드를 삭제할 수 있다.Also, the node reconfiguration process may delete the deletion node when the node of the next node and the deletion node are not the same when the node is deleted from the bidirectional list, and the deletion node and the previous node have the same line.

또한, 상기 노드 재구성 공정은, 상기 양방향 리스트에서 노드 삭제시, 다음 노드와 삭제 노드의 라인이 동일하지 않고, 상기 삭제 노드와 이전 노드의 라인이 동일하지 않으며, 상기 다음 노드가 종료 노드인 경우, 상기 다음 노드의 라인을 감소시킬 수 있다.Also, the node reconfiguration process may be configured such that, when the node is deleted from the bidirectional list, the lines of the next node and the deletion node are not the same, the lines of the deletion node and the previous node are not the same, It is possible to reduce the line of the next node.

또한, 상기 표현 재구성 공정은, 상기 표현의 시작 노드 및 종료 노드를 이용하여 상기 양방향 리스트에 상기 표현에 포함된 복수의 노드를 삽입하거나 삭제할 수 있다.Also, the expression reconstruction process may insert or delete a plurality of nodes included in the expression in the bi-directional list using the start node and the end node of the expression.

또한, 상기 노드 값 치환 공정은, 치환 노드의 노드 값 길이와 이전 노드의 노드 값 길이의 차이값을 계산한 후, 상기 치환 노드와 다음 노드의 라인이 동일한 경우, 상기 다음 노드의 컬럼을 상기 차이값에 대응하도록 증감시킬 수 있다.The node value replacing step calculates a difference value between the length of the node value of the replacement node and the length of the node value of the previous node, and then, when the replacement node and the line of the next node are the same, Value corresponding to the value.

아울러, 상기 코드 생성 단계는, 수정된 상기 양방향 리스트의 종료 노드의 종료 라인 번호를 신규 코드의 전체 라인의 수로 계산하는 전체 라인 수 계산 공정; 상기 전체 라인에 대응하는 스트링을 리스트로 저장하는 스트링 저장 공정; 및 수정된 상기 양방향 리스트를 순회하면서 상기 스트링을 각각의 라인에 치환하여 상기 신규 코드를 생성하는 신규 코드 생성 공정;을 포함할 수 있다.In addition, the code generation step may include: a total line number calculation step of calculating the end line number of the end node of the modified bidirectional list as the total number of lines of the new code; A string storing step of storing a string corresponding to the entire line as a list; And a new code generation step of generating the new code by replacing the string with each line while traversing the modified bi-directional list.

상기한 바와 같이 본 발명에 따른 프로그래밍 언어간 변환 방법에 의하면, 소스 코드의 문법체계를 고려하여 소스 코드의 주석 및 틀을 유지하면서 신규 언어로 변환함으로써 신규 언어의 정확성을 향상시키고, 또한 신규 언어에 대한 개발자의 개발 시간과 노력을 절약할 수 있는 효과가 있다.As described above, according to the method for converting between programming languages according to the present invention, it is possible to improve the accuracy of a new language by converting it into a new language while maintaining the annotation and frame of the source code in consideration of the grammar system of the source code, This can save developers time and effort.

도 1은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 블럭도이다.
도 2는 본 발명에 따른 구문 분석 단계의 블럭도이다.
도 3은 본 발명에 따른 추상 구문 트리의 예시도이다.
도 4는 본 발명에 따른 양방향 리스트의 예시도이다.
도 5는 본 발명에 따른 트리 재구성 단계의 블럭도이다.
도 6은 본 발명에 따른 노드 재구성 공정의 제 1흐름도이다.
도 7은 본 발명에 따른 노드 재구성 공정의 제 2흐름도이다.
도 8은 본 발명에 따른 노드 값 치환 공정의 흐름도이다.
도 9는 본 발명에 따른 코드 생성 단계의 블럭도이다.
도 10은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 제 1예시이다.
도 11은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 제 2예시이다.
1 is a block diagram of a method for converting between programming languages according to an embodiment of the present invention.
2 is a block diagram of the parsing step according to the present invention.
Figure 3 is an illustration of an abstract syntax tree according to the present invention.
4 is an exemplary diagram of a bi-directional list according to the present invention.
5 is a block diagram of a tree reconstruction step according to the present invention.
Figure 6 is a first flow diagram of a node reconfiguration process in accordance with the present invention.
7 is a second flow diagram of a node reconfiguration process in accordance with the present invention.
8 is a flowchart of a node value replacement process according to the present invention.
9 is a block diagram of a code generation step according to the present invention.
FIG. 10 is a first example of a method for converting between programming languages according to an embodiment of the present invention.
11 is a second example of a method of converting between programming languages according to an embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 발명의 실시 예를 상세히 설명한다. 우선, 도면들 중 동일한 구성요소 또는 부품들은 가능한 한 동일한 참조부호를 나타내고 있음에 유의해야 한다. 본 발명을 설명함에 있어서 관련된 공지기능 혹은 구성에 대한 구체적인 설명은 본 발명의 요지를 모호하게 하지 않기 위해 생략한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. First, it should be noted that the same components or parts among the drawings denote the same reference numerals whenever possible. In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted so as not to obscure the subject matter of the present invention.

도 1은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 블럭도이다.1 is a block diagram of a method for converting between programming languages according to an embodiment of the present invention.

본 발명에 따른 프로그래밍 언어간 변환 방법은 컴퓨터상에서 수행되는 프로그래밍 언어 변환기를 이용하여 수행할 수 있다.The programming language conversion method according to the present invention can be performed using a programming language converter implemented on a computer.

구체적으로, 본 발명에 따른 프로그래밍 언어간 변환 방법은 도 1에 도시된 바와 같이, 구문 분석 단계(S10), 트리 재구성 단계(S20) 및 코드 생성 단계(S30)를 포함할 수 있다.Specifically, the method for converting between programming languages according to the present invention may include a syntax analysis step (S10), a tree reconstruction step (S20) and a code generation step (S30), as shown in FIG.

도 2는 본 발명에 따른 구문 분석 단계의 블럭도이다.2 is a block diagram of the parsing step according to the present invention.

상기 구문 분석 단계(S10)는 소스 코드를 분석하여 추상 구문 트리와 양방향 리스트를 각각 생성하는 단계다.The parsing step (S10) is a step of generating an abstract syntax tree and a bidirectional list by analyzing the source code.

상기 구문 분석 단계(S10)는 도 2에 도시된 바와 같이, 토큰 생성 공정(S11), 추상 구문 트리 생성 공정(S12) 및 양방향 리스트 생성 공정(S13)을 포함할 수 있다.The syntax analysis step S10 may include a token generation step S11, an abstract syntax tree generation step S12, and a bidirectional list generation step S13 as shown in FIG.

상기 토큰 생성 공정(S11)은 상기 소스 코드로부터 개별 요소를 분해하여 복수의 토큰을 생성하는 공정이다.The token generating step S11 is a step of generating a plurality of tokens by decomposing individual elements from the source code.

구체적으로, 상기 토큰 생성 공정(S11)에서는 프로그래밍 언어 변환기에 구비된 렉서를 통해, 소스 코드로부터 연산자, 괄호, 식별자 등의 개별 요소를 분해한 후, 토큰, 즉 소스 코드로부터 분해한 개별 요소를 해당 변환기에 구비된 구문분석기에 전달할 수 있다.Specifically, in the token generation step (S11), individual elements such as an operator, a parenthesis, and an identifier are decomposed from a source code through a lexer provided in a programming language converter, and then individual elements decomposed from a token, To the parser provided in the converter.

이때, 상기 토큰 생성 공정(S11)에서는 상기 소스 코드에 주석, 즉 프로그램과 관련없는 설명 문구가 존재하는 경우, 상기 주석을 상기 토큰에 저장한 후 해당 토크를 상기 구문분석기에 전달할 수 있다.At this time, in the token generating step S11, if there is an annotation in the source code, that is, a description related to the program, the annotation may be stored in the token, and the corresponding torque may be transmitted to the parser.

일반적으로, 컴파일 과정에서는 소스 코드에 주석이 존재하는 경우, 주석을 모두 제거한 후 토큰을 전달하지만, 본원발명과 같이, 특정 프로그래밍 언어를 다른 프로그래밍 언어로 변환하는 과정에서 주석을 모두 제거하는 경우 변환된 프로그래밍 언어를 쉽게 이해할 수 없는 문제점이 발생할 수 있다.In general, when a comment exists in the source code in the compiling process, the token is delivered after all the comments are removed. However, when the comment is removed in the process of converting a specific programming language into another programming language as in the present invention, There is a problem that the programming language can not be easily understood.

따라서, 본원발명의 토큰 생성 공정(S11)에서는 변환 전 프로그래밍 언어의 주석을 변환 후 프로그래밍 언어 상에 정확히 유지할 수 있도록, 해당 주석을 제거하지 않고 토큰에 저장하여 전달함으로써 프로그래밍 언어의 변환시 해당 토큰으로부터 주석을 용이하게 추출하도록 할 수 있다.Accordingly, in the token generation step S11 of the present invention, the annotations of the pre-conversion programming language are stored in the token without removing the annotations so that they can be accurately maintained on the programming language after conversion, Can be easily extracted.

도 3은 본 발명에 따른 추상 구문 트리의 예시도이다.Figure 3 is an illustration of an abstract syntax tree according to the present invention.

상기 추상 구문 트리 생성 공정(S12)은 상기 토큰을 표현 노드 또는 단말 노드로 변환하여 상기 추상 구문 트리를 생성하는 공정이다.The abstract syntax tree generation process S12 is a process of converting the token into a presentation node or a terminal node to generate the abstract syntax tree.

구체적으로, 상기 추상 구문 트리 생성 공정(S12)에서는 구문분석기를 통해, 렉서로부터 전달된 복수의 토큰이 주어진 문법에 맞는지 각각 분석하여 각각의 토큰을 도 3에 도시된 바와 같이, 표현 노드 또는 단말 노드로 변환하여 추상 구문 트리를 생성할 수 있다.Specifically, in the abstract syntax tree generation step (S12), a plurality of tokens transmitted from the lexer are analyzed through a syntax analyzer to analyze each token according to a given grammar, To generate an abstract syntax tree.

여기서, 상기 표현 노드는 그 속성으로 시작 노드 및 종료 노드를 각각 저장할 수 있고, 또한, 상기 단말 노드는 그 속성으로 시작 컬럼, 시작 라인, 종료 컬럼 및 종료 라인을 각각 저장할 수 있다.Here, the expression node can store a start node and an end node respectively as its attributes, and the terminal node can also store a start column, a start line, an end column, and an end line as attributes thereof.

즉, 본원발명에서는 상기한 바와 같이, 표현 노드에 시작 노드 및 종료 노드를 각각 저장함으로써 후술하는 바와 같이, 해당 표현 노드를 삭제할 때 양방향 리스트에서 시작 노드와 종료 노드의 기준점으로 작용할 수 있고, 단말 노드에 시작 컬럼, 시작 라인, 종료 컬럼 및 종료 라인을 각각 저장함으로써 변환 전 프로그래밍 언어의 틀을 유지하며 해당 프로그래밍 언어를 신규 언어로 변환할 수 있다.That is, in the present invention, as described later, when the corresponding node is deleted, the start node and the end node are stored in the representative node, respectively, as described above, and can act as reference points of the start node and the end node in the bidirectional list. The start column, the start line, the end column, and the end line, respectively, to store the pre-conversion programming language and convert the programming language into a new language.

도 4는 본 발명에 따른 양방향 리스트의 예시도이다.4 is an exemplary diagram of a bi-directional list according to the present invention.

상기 양방향 리스트 생성 공정(S13)은 상기 단말 노드를 연결하여 상기 양방향 리스트를 생성하는 공정이다.The bidirectional list generating step S13 is a step of connecting the terminal node to generate the bidirectional list.

구체적으로, 상기 양방향 리스트 생성 공정(S13)에서는 상기 토큰에 주석이 저장된 경우, 상기 토큰으로부터 주석을 추출하여 도 4에 도시된 바와 같이, 상기 양방향 리스트에 주석 노드, 즉, 주석의 내용을 포함하고 있는 노드를 포함시킬 수 있다.More specifically, in the bidirectional list generating process (S13), when a comment is stored in the token, an annotation is extracted from the token, and the contents of the annotation node, that is, the comment, is included in the bidirectional list You can include a node.

본원발명에서는 상기 추상 구문 트리의 생성시 토큰이 노드로 변환되는 경우, 양방향 리스트에도 해당 노드가 포함되는데, 이때 트리 생성시 사용된 토큰에 저장된 주석을 해당 노드 앞에 삽입할 수 있다. 이는 트리를 재구성할 때 만나는 노드를 시작으로 순회하면서 다음 노드의 컬럼과 라인을 증가하게 되는데 주석 노드도 증가해야 하기 때문이다.In the present invention, when a token is converted into a node at the time of creation of the abstract syntax tree, the corresponding node is also included in the bidirectional list. At this time, the annotation stored in the token used at the time of generating the tree can be inserted in front of the node. This is because, when the tree is reconstructed, it traverses from the node that starts to meet, and increases the columns and lines of the next node.

도 5는 본 발명에 따른 트리 재구성 단계의 블럭도이다.5 is a block diagram of a tree reconstruction step according to the present invention.

상기 트리 재구성 단계(S20)는 상기 추상 구문 트리를 탐색하면서 상기 양방향 리스트를 수정하는 단계이다.The tree reconstruction step S20 is a step of modifying the bidirectional list while searching the abstract syntax tree.

상기 트리 재구성 단계(S20)는 도 5에 도시된 바와 같이, 노드 재구성 공정(S21), 표현 재구성 공정(S22) 및 노드 값 치환 공정(S23)을 포함할 수 있다.The tree reconstruction step S20 may include a node reconstruction process S21, a representation reconstruction process S22, and a node value replacement process S23, as shown in FIG.

상기 노드 재구성 공정(S21)은 상기 양방향 리스트에 노드를 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 공정이다.The node reconstruction process S21 is a process of modifying the bidirectional list by inserting or deleting nodes in the bidirectional list.

도 6은 본 발명에 따른 노드 재구성 공정의 제 1흐름도이다. Figure 6 is a first flow diagram of a node reconfiguration process in accordance with the present invention.

상기 노드 재구성 공정(S21)은 도 6에 도시된 바와 같이, 상기 양방향 리스트에 노드를 삽입하여 상기 양방향 리스트를 수정할 수 있다.The node reconstruction process S21 may modify the bidirectional list by inserting nodes into the bidirectional list, as shown in FIG.

구체적으로, 상기 노드 재구성 공정(S21)에서는 상기 양방향 리스트에 노드를 삽입한 경우, 자신의 노드인 삽입 노드와 이전 노드의 라인 차이가 0보다 크거나 또는 다음 노드와 상기 삽입 노드의 라인 차이가 0보다 큰 경우가 발생할 수 있다.Specifically, when the node is inserted into the bidirectional list in the node reconstruction process (S21), if the line difference between the insertion node and the previous node, which is a node of the node, is greater than 0 or the line difference between the next node and the insertion node is 0 May occur.

이때, 상기 다음 노드가 마지막 노드로써 종료 노드인 경우, 해당 다음 노드의 라인을 증가시킴으로써 양방향 리스트를 수정할 수 있다.At this time, if the next node is an end node as the last node, the bi-directional list can be modified by increasing the line of the next node.

또한, 상기 노드 재구성 공정(S21)에서는 다른 조건은 동일하되, 상기 다음 노드가 종료 노드가 아닌 경우가 발생할 수 있는데, 이때, 상기 다음 노드와 삽입 노드의 라인이 동일한 경우 상기 다음 노드의 컬럼을 상기 삽입 노드의 길이만큼 증가시킴으로써 양방향 리스트를 수정할 수 있다.In the node reconstruction process (S21), another condition may be the same, but the next node may not be the final node. If the next node and the insertion node have the same line, The bidirectional list can be modified by increasing the length of the insertion node.

아울러, 상기 노드 재구성 공정(S21)에서는 다른 조건은 동일하되, 상기 이전 노드와 삽입 노드의 라인이 동일한 경우 상기 다음 노드의 라인을 변경시키지 않으며 양방향 리스트의 수정을 완료할 수 있고, 이와 반대로 상기 이전 노드와 삽입 노드의 라인이 동일하지 않는 경우 상기 다음 노드의 라인을 증가시킴으로써 양방향 리스트를 수정할 수 있다.In addition, in the node reconfiguration process (S21), other conditions are the same, but if the lines of the previous node and the insertion node are the same, the modification of the bidirectional list can be completed without changing the line of the next node, The bidirectional list can be modified by increasing the line of the next node when the node and the line of the insertion node are not the same.

즉, 본원발명에서는 상기 노드 재구성 공정(S21)을 통해 노드를 삽입하는 경우, 기준이 되는 노드의 컬럼 번호 및 라인 번호를 기초로 새로운 노드의 위치가 결정되고, 또한 해당 위치가 결정되면 컬럼 증가분 및 라인 증가분을 계산하여 다음 노드부터 적용하게 된다.That is, in the present invention, when a node is inserted through the node reconstruction process (S21), the position of a new node is determined based on a column number and a line number of a reference node, and when a corresponding position is determined, The line increment is calculated and applied from the next node.

따라서, 삽입 노드와 다음 노드가 라인이 같다면 동일 라인에 해당하는 노드들까지만 컬럼의 증가가 발생되고, 삽입 노드가 다음 노드 및 이전 노드와 각각 라인이 같지 않다면 라인의 증가가 발생한다.Therefore, if the insertion node and the next node are the same, only the columns corresponding to the same line are incremented. If the insertion node is not the same as the next node and the previous node, an increase of the line occurs.

이때, 신규 노드가 빈 라인에 삽입이 되는지 또는 노드와 노드 사이에 삽입이 되는지에 따라 라인의 증가가 발생하게 되며, 라인 증가는 마지막 노드인 종료 노드까지 계산될 수 있다.At this time, an increase in the line occurs depending on whether the new node is inserted into the empty line or inserted between the node and the node, and the line increase can be calculated to the final node, which is the last node.

도 7은 본 발명에 따른 노드 재구성 공정의 제 2흐름도이다. 7 is a second flow diagram of a node reconfiguration process in accordance with the present invention.

한편, 상기 노드 재구성 공정(S21)은 도 7에 도시된 바와 같이, 상기 양방향 리스트에서 노드를 삭제하여 상기 양방향 리스트를 수정할 수 있다.Meanwhile, the node reconfiguration process S21 may modify the bidirectional list by deleting nodes from the bidirectional list, as shown in FIG.

구체적으로, 상기 노드 재구성 공정(S21)에서는 다음 노드와 자신의 노드인 삭제 노드의 라인이 동일한 경우가 발생할 수 있는데, 이때, 상기 다음 노드의 컬럼을 상기 삭제 노드의 길이만큼 감소시킴으로써 양방향 리스트를 수정할 수 있다.Specifically, in the node reconstruction process (S21), it may happen that the next node and the deletion node, which is its own node, are the same. At this time, the bi-directional list is modified by decreasing the column of the next node by the length of the deletion node .

또한, 상기 노드 재구성 공정(S21)에서는 다음 노드와 삭제 노드의 라인이 동일하지 않는 경우가 발생할 수 있는데, 이때, 상기 삭제 노드와 이전 노드의 라인이 동일한 경우, 상기 삭제 노드를 삭제시킴으로써 양방향 리스트의 수정을 완료할 수 있다.Also, in the node reconstruction process (S21), there may occur a case where the lines of the next node and the deletion node are not the same. At this time, if the deletion node and the previous node have the same line, The modification can be completed.

아울러, 상기 노드 재구성 공정(S21)에서는 다른 조건은 동일하되, 상기 삭제 노드와 이전 노드의 라인이 동일하지 않고, 또한 상기 다음 노드가 마지막 노드로써 종료 노드인 경우, 상기 다음 노드의 라인을 감소시킴으로써 양방향 리스트를 수정할 수 있다.In addition, in the node reconstruction process (S21), the other conditions are the same, and if the deletion node and the line of the previous node are not the same and the next node is the final node, You can modify the bidirectional list.

상기 표현 재구성 공정(S22)은 상기 양방향 리스트에 표현을 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 공정이다.The expression reconstitution step S22 is a step of modifying the bi-directional list by inserting or deleting a representation in the bi-directional list.

구체적으로, 상기 표현 재구성 공정(S22)에서는 표현의 시작 노드 및 종료 노드를 이용하여 상기 양방향 리스트에 상기 표현에 포함된 복수의 노드를 삽입하거나 삭제할 수 있다.Specifically, in the expression reconstitution step (S22), a plurality of nodes included in the expression may be inserted or deleted in the bidirectional list by using the start node and the end node of the expression.

즉, 상기 표현 재구성 공정(S22)에서는 상기 표현에 포함된 시작 노드부터 종료 노드까지의 복수의 노드에 대해 양방향 리스트를 순회하면서 도 6에 도시된 바와 같은 동일한 방법으로, 각각의 노드에 대해 해당 노드를 삽입하거나, 도 7에 도시된 바와 같은 동일한 방법으로, 각각의 노드에 대해 해당 노드를 삭제하여 양방향 리스트를 수정할 수 있다.That is, in the expression reconstitution process S22, the bidirectional list is traversed for a plurality of nodes from the start node to the end node included in the expression, , Or modify the bi-directional list by deleting the corresponding node for each node in the same manner as shown in Fig.

도 8은 본 발명에 따른 노드 값 치환 공정의 흐름도이다.8 is a flowchart of a node value replacement process according to the present invention.

상기 노드 값 치환 공정(S23)은 상기 양방향 리스트의 노드 값을 치환하여 상기 양방향 리스트를 수정하는 공정이다.The node value replacing step (S23) is a step of modifying the bidirectional list by replacing the node value of the bidirectional list.

구체적으로, 상기 노드 값 치환 공정(S23)에서는 도 8에 도시된 바와 같이, 자신의 노드인 치환 노드의 노드 값 길이와 이전 노드의 노드 값 길이의 차이값을 계산할 수 있다.Specifically, in the node value replacing step (S23), as shown in FIG. 8, the difference value between the length of the node value of the substitution node as its own node and the length of the node value of the previous node can be calculated.

이후, 상기 치환 노드와 다음 노드의 라인이 동일한 경우 상기 다음 노드의 컬럼을 상기 차이값에 대응하도록 증감시킬 수 있다.Thereafter, if the replacement node is the same as the next node, the column of the next node may be increased or decreased to correspond to the difference value.

즉, 상기 노드 값 치환 공정(S23)에서는 치환 노드와 이전 노드의 노드 값 길이의 차이값이 (+)인 경우, 즉, 치환 노드의 노드 값이 이전 노드의 노드 값보다 큰 경우, 상기 다음 노드의 컬럼을 해당 차이값 만큼 증가시킬 수 있다.That is, in the node value replacement step (S23), when the difference value of the node value length between the replacement node and the previous node is (+), that is, when the node value of the replacement node is larger than the node value of the previous node, Can be increased by the corresponding difference value.

이에 반해, 치환 노드와 이전 노드의 노드 값 길이의 차이값이 (-)인 경우, 즉, 치환 노드의 노드 값이 이전 노드의 노드 값보다 작은 경우, 상기 다음 노드의 컬럼을 해당 차이값 만큼 감소시킬 수 있다.On the other hand, when the difference value between the node lengths of the substitution node and the previous node is negative (i.e., the node value of the replacement node is smaller than the node value of the previous node), the column of the next node is decreased .

한편, 상기 노드 값 치환 공정(S23)에서는 상기 치환 노드와 다음 노드의 라인이 동일하지 않은 경우 상기 다음 노드의 컬럼을 변경시키지 않으며 양방향 리스트의 수정을 완료할 수 있다.Meanwhile, in the node value replacement step (S23), if the replacement node and the next node do not have the same line, the modification of the bidirectional list can be completed without changing the column of the next node.

도 9는 본 발명에 따른 코드 생성 단계의 블럭도이다.9 is a block diagram of a code generation step according to the present invention.

상기 코드 생성 단계(S30)는 수정된 상기 양방향 리스트로부터 신규 코드를 생성하는 단계다.The code generation step S30 is a step of generating a new code from the modified bi-directional list.

구체적으로, 상기 코드 생성 단계(S30)는 도 9에 도시된 바와 같이, 전체 라인 수 계산 공정(S31), 스트링 저장 공정(S32) 및 신규 코드 생성 공정(S33)을 포함할 수 있다.Specifically, the code generation step S30 may include a total line number calculation step S31, a string storage step S32, and a new code generation step S33 as shown in FIG.

상기 전체 라인 수 계산 공정(S31)은 수정된 상기 양방향 리스트의 마지막 노드인 종료 노드의 종료 라인 번호를 신규 코드의 전체 라인의 수로 계산하는 공정이다.The total line number calculation step S31 is a step of calculating the ending line number of the end node, which is the last node of the modified bidirectional list, by the total number of lines of the new code.

상기 스트링 저장 공정(S32)은 상기 전체 라인에 대응하는 스트링을 리스트로 저장하는 공정이다.The string storing step S32 is a step of storing the strings corresponding to the entire lines as a list.

상기 신규 코드 생성 공정(S33)은 수정된 상기 양방향 리스트를 순회하면서 상기 스트링을 각각의 라인에 치환하여 상기 신규 코드를 생성하는 공정이다.The new code generating step (S33) is a step of generating the new code by repeating the modified bi-directional list while replacing the string with each line.

상기 신규 코드 생성 공정(S33)에서는 수정된 양방향 리스트의 시작 노드부터 종료 노드까지 순회하면서 각각의 라인에 시작 컬럼과 종료 컬럼을 이용하여 상기 스트링을 치환함으로써 변경된 소스를 생성할 수 있다.In the new code generation step (S33), the modified source can be generated by traversing from the start node to the end node of the modified bi-directional list and replacing the string by using a start column and an end column in each line.

도 10은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 제 1예시이고, 도 11은 본 발명의 일 실시예에 따른 프로그래밍 언어간 변환 방법의 제 2예시이다.FIG. 10 is a first example of a method of converting between programming languages according to an embodiment of the present invention, and FIG. 11 is a second example of a method of converting between programming languages according to an embodiment of the present invention.

상술한 바와 같이, 본 발명에 따른 프로그래밍 언어간 변환 방법에 의하면, 상위 언어가 기존 언어의 제어문 구조를 포함하도록, 도 10 및 도 11에 도시된 바와 같이, 대부분의 언어에서 사용되는 do while 문 및 switch 문을 각각 상위 언어인 Stored Procedure에서 Repeat Until 문 및 CASE WHEN 문으로 치환하여 프로그래밍 언어간 변환을 수행할 수 있다.As described above, according to the method for converting between programming languages according to the present invention, as shown in FIGS. 10 and 11, the do-while-statements and the do- You can perform the conversion between programming languages by replacing the switch statement with the Repeat Until statement and the CASE WHEN statement in the stored procedure, respectively.

이처럼, 본 발명에 따르면, 소스 코드의 문법체계를 고려하여 소스 코드의 주석 및 틀을 유지하면서 신규 언어로 변환함으로써 신규 언어의 정확성을 향상시킬 수 있고, 또한 신규 언어에 대한 개발자의 개발 시간과 노력을 절약할 수 있다.As described above, according to the present invention, it is possible to improve the accuracy of a new language by converting into a new language while maintaining the annotation and frame of the source code in consideration of the grammar system of the source code, Can be saved.

이상과 같이 본 발명에 따른 프로그래밍 언어간 변환 방법을 예시한 도면을 참조로 하여 설명하였으나, 본 명세서에 개시된 실시예와 도면에 의해 본 발명이 한정되는 것은 아니며, 본 발명의 기술사상 범위 내에서 당업자에 의해 다양한 변형이 이루어질 수 있음은 물론이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, It will be understood that various modifications may be made by those skilled in the art.

S10:구문 분석 단계
S11:토큰 생성 공정
S12:추상 구문 트리 생성 공정
S13:양방향 리스트 생성 공정
S20:트리 재구성 단계
S21:노드 재구성 공정
S22:표현 재구성 공정
S23:노드 값 치환 공정
S30:코드 생성 단계
S31:전체 라인 수 계산 공정
S32:스트링 저장 공정
S33:신규 코드 생성 공정
S10: Parsing step
S11: Token generation process
S12: Abstract syntax tree generation process
S13: Bi-directional list generation process
S20: tree reconstruction step
S21: Node reconstruction process
S22: Representative reconstruction process
S23: Node value replacement process
S30: Code generation step
S31: total line number calculation step
S32: String storage process
S33: New code generation process

Claims (16)

소스 코드를 분석하여 추상 구문 트리와 양방향 리스트를 각각 생성하는 구문 분석 단계;
상기 추상 구문 트리를 탐색하면서 상기 양방향 리스트를 수정하는 트리 재구성 단계; 및
수정된 상기 양방향 리스트로부터 신규 코드를 생성하는 코드 생성 단계;
를 포함하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
A parsing step of analyzing the source code to generate an abstract syntax tree and a bidirectional list, respectively;
A tree reconstruction step of modifying the bidirectional list while searching the abstract syntax tree; And
A code generation step of generating a new code from the modified bi-directional list;
Wherein the program is executed on a computer.
제 1항에 있어서,
상기 구문 분석 단계는,
상기 소스 코드로부터 개별 요소를 분해하여 복수의 토큰을 생성하는 토큰 생성 공정;
상기 토큰을 표현 노드 또는 단말 노드로 변환하여 상기 추상 구문 트리를 생성하는 추상 구문 트리 생성 공정; 및
상기 단말 노드를 연결하여 상기 양방향 리스트를 생성하는 양방향 리스트 생성 공정;
을 포함하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
The method according to claim 1,
Wherein the parsing step comprises:
A token generating step of generating a plurality of tokens by decomposing individual elements from the source code;
An abstract syntax tree generating step of converting the token into a presentation node or a terminal node to generate the abstract syntax tree; And
A bidirectional list generating step of generating the bidirectional list by connecting the terminal node;
And converting the program code into a program code.
제 2항에 있어서,
상기 토큰 생성 공정은,
상기 소스 코드의 주석을 상기 토큰에 저장하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
3. The method of claim 2,
The token generating step includes:
And storing the annotations of the source code in the token.
제 3항에 있어서,
상기 추상 구문 트리 생성 공정은,
상기 표현 노드의 속성으로 시작 노드 및 종료 노드를 저장하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
The method of claim 3,
The abstract syntax tree generation process includes:
And the start node and the end node are stored as attributes of the expression node.
제 3항에 있어서,
상기 추상 구문 트리 생성 공정은,
상기 단말 노드의 속성으로 시작 컬럼, 시작 라인, 종료 컬럼 및 종료 라인을 저장하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
The method of claim 3,
The abstract syntax tree generation process includes:
Wherein a start column, a start line, an end column and an end line are stored as attributes of the terminal node.
제 3항에 있어서,
상기 양방향 리스트 생성 공정은,
상기 토큰에 주석이 저장된 경우, 상기 토큰으로부터 주석을 추출하여 상기 양방향 리스트에 주석 노드를 포함시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
The method of claim 3,
Wherein the bi-directional list generation step comprises:
And if an annotation is stored in the token, extracting the annotation from the token and including the annotation node in the bidirectional list.
제 3항에 있어서,
상기 트리 재구성 단계는,
상기 양방향 리스트에 노드를 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 노드 재구성 공정;
상기 양방향 리스트에 표현을 삽입하거나 삭제하여 상기 양방향 리스트를 수정하는 표현 재구성 공정; 및
상기 양방향 리스트의 노드 값을 치환하여 상기 양방향 리스트를 수정하는 노드 값 치환 공정;
을 포함하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
The method of claim 3,
Wherein the tree reconstruction step comprises:
A node reconstruction process for modifying the bidirectional list by inserting or deleting a node in the bidirectional list;
A representation reconstruction process for modifying the bi-directional list by inserting or deleting a representation in the bi-directional list; And
A node value replacing step of replacing the node value of the bidirectional list to correct the bidirectional list;
And converting the program code into a program code.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에 노드 삽입시,
삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드인 경우,
상기 다음 노드의 라인을 증가시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon inserting a node into the bidirectional list,
If the difference between the insertion node and the line of the previous node or the difference between the line of the next node and the insertion node is greater than 0 and the next node is the end node,
And incrementing the line of the next node.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에 노드 삽입시,
삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드가 아닌 경우,
상기 다음 노드와 삽입 노드의 라인이 동일한 경우 상기 다음 노드의 컬럼을 상기 삽입 노드의 길이만큼 증가시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon inserting a node into the bidirectional list,
If the difference between the insertion node and the line of the previous node or the difference between the line of the next node and the insertion node is larger than 0 and the next node is not the end node,
And if the line of the next node is the same as the line of the next node, the column of the next node is increased by the length of the insert node.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에 노드 삽입시,
삽입 노드와 이전 노드의 라인의 차이 또는 다음 노드와 삽입 노드의 라인의 차이가 0보다 크고, 상기 다음 노드가 종료 노드가 아닌 경우,
상기 이전 노드와 삽입 노드의 라인이 동일하지 않는 경우 상기 다음 노드의 라인을 증가시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon inserting a node into the bidirectional list,
If the difference between the insertion node and the line of the previous node or the difference between the line of the next node and the insertion node is larger than 0 and the next node is not the end node,
And increasing the line of the next node if the line of the previous node and the line of the insertion node are not the same.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에 노드 삭제시,
다음 노드와 삭제 노드의 라인이 동일한 경우,
상기 다음 노드의 컬럼을 상기 삭제 노드의 길이만큼 감소시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon deleting a node in the bidirectional list,
If the next node and the delete node have the same line,
And decreasing the column of the next node by the length of the deletion node.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에서 노드 삭제시,
다음 노드와 삭제 노드의 라인이 동일하지 않고, 상기 삭제 노드와 이전 노드의 라인이 동일한 경우,
상기 삭제 노드를 삭제하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon deleting a node from the bi-directional list,
If the lines of the next node and the delete node are not the same and the lines of the delete node and the previous node are the same,
And deleting the delete node.
제 7항에 있어서,
상기 노드 재구성 공정은,
상기 양방향 리스트에서 노드 삭제시,
다음 노드와 삭제 노드의 라인이 동일하지 않고, 상기 삭제 노드와 이전 노드의 라인이 동일하지 않으며, 상기 다음 노드가 종료 노드인 경우,
상기 다음 노드의 라인을 감소시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node reconstruction process includes:
Upon deleting a node from the bi-directional list,
If the lines of the next node and the deletion node are not the same and the lines of the deletion node and the previous node are not the same and the next node is the end node,
And reducing the line of the next node.
제 7항에 있어서,
상기 표현 재구성 공정은,
상기 표현의 시작 노드 및 종료 노드를 이용하여 상기 양방향 리스트에 상기 표현에 포함된 복수의 노드를 삽입하거나 삭제하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The expression reconstitution process includes:
Wherein a plurality of nodes included in the expression are inserted or deleted in the bidirectional list using the start node and the end node of the expression.
제 7항에 있어서,
상기 노드 값 치환 공정은,
치환 노드의 노드 값 길이와 이전 노드의 노드 값 길이의 차이값을 계산한 후,
상기 치환 노드와 다음 노드의 라인이 동일한 경우,
상기 다음 노드의 컬럼을 상기 차이값에 대응하도록 증감시키는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
The node value replacing step includes:
After calculating the difference between the node value length of the replacement node and the node value length of the previous node,
If the substitution node and the next node are the same,
And the column of the next node is increased or decreased to correspond to the difference value.
제 7항에 있어서,
상기 코드 생성 단계는,
수정된 상기 양방향 리스트의 종료 노드의 종료 라인 번호를 신규 코드의 전체 라인의 수로 계산하는 전체 라인 수 계산 공정;
상기 전체 라인에 대응하는 스트링을 리스트로 저장하는 스트링 저장 공정; 및
수정된 상기 양방향 리스트를 순회하면서 상기 스트링을 각각의 라인에 치환하여 상기 신규 코드를 생성하는 신규 코드 생성 공정;
을 포함하는 것을 특징으로 하는 컴퓨터 상에서 구현되는 프로그래밍 언어간 변환 방법.
8. The method of claim 7,
Wherein the code generation step comprises:
Calculating an end line number of the end node of the modified bidirectional list as the total number of lines of the new code;
A string storing step of storing a string corresponding to the entire line as a list; And
A new code generating step of generating the new code by replacing the string with each line while traversing the modified bi-directional list;
And converting the program code into a program code.
KR1020170048412A 2017-04-14 2017-04-14 Conversion method of programming language KR101952328B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170048412A KR101952328B1 (en) 2017-04-14 2017-04-14 Conversion method of programming language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170048412A KR101952328B1 (en) 2017-04-14 2017-04-14 Conversion method of programming language

Publications (2)

Publication Number Publication Date
KR20180115921A true KR20180115921A (en) 2018-10-24
KR101952328B1 KR101952328B1 (en) 2019-02-26

Family

ID=64132461

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170048412A KR101952328B1 (en) 2017-04-14 2017-04-14 Conversion method of programming language

Country Status (1)

Country Link
KR (1) KR101952328B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282336A (en) * 2021-06-11 2021-08-20 重庆大学 Code abstract integration method based on quality assurance framework

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040045143A (en) * 2002-11-22 2004-06-01 엘지전자 주식회사 Method for generating source code
KR20100057495A (en) 2008-11-21 2010-05-31 고려대학교 산학협력단 System and method for translating high-level programming language code into hardware description language code
JP2010140408A (en) * 2008-12-15 2010-06-24 Nomura Research Institute Ltd Source code converting device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040045143A (en) * 2002-11-22 2004-06-01 엘지전자 주식회사 Method for generating source code
KR20100057495A (en) 2008-11-21 2010-05-31 고려대학교 산학협력단 System and method for translating high-level programming language code into hardware description language code
JP2010140408A (en) * 2008-12-15 2010-06-24 Nomura Research Institute Ltd Source code converting device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282336A (en) * 2021-06-11 2021-08-20 重庆大学 Code abstract integration method based on quality assurance framework
CN113282336B (en) * 2021-06-11 2023-11-10 重庆大学 Code abstract integration method based on quality assurance framework

Also Published As

Publication number Publication date
KR101952328B1 (en) 2019-02-26

Similar Documents

Publication Publication Date Title
US9710243B2 (en) Parser that uses a reflection technique to build a program semantic tree
US10698682B1 (en) Computerized software development environment with a software database containing atomic expressions
US8091071B2 (en) Method and system for template-based code generation
Collard et al. srcml: An infrastructure for the exploration, analysis, and manipulation of source code: A tool demonstration
US9146712B2 (en) Extensible code auto-fix framework based on XML query languages
US11775414B2 (en) Automated bug fixing using deep learning
US9122540B2 (en) Transformation of computer programs and eliminating errors
JPS6375835A (en) Apparatus for generating intended code, program, list and design document
CN108595334B (en) Method and device for calculating dynamic slices of Java program and readable storage medium
US11294665B1 (en) Computerized software version control with a software database and a human database
JP2012063868A (en) Method to generate combined parser by combining language processing parsers, and its computer and computer program
CN115509514A (en) Front-end data simulation method, device, equipment and medium
KR101952328B1 (en) Conversion method of programming language
CN111190643A (en) Program code annotation generation method, system, electronic device and storage medium
Zhang et al. Automated extraction of grammar optimization rule configurations for metamodel-grammar co-evolution
CN110554860B (en) Construction method and code generation method of software project natural language programming interface (NLI)
CN113608748A (en) Data processing method, device and equipment for converting C language into Java language
Kulkarni et al. Generating and analyzing test cases from software requirements using nlp and hadoop
JP7522353B2 (en) Code change pattern mining program and code change pattern mining method
CN113641361B (en) Code hiding method and device based on Clang
CN114816356A (en) System and method for generating HTTP request code based on interface document
JP6502044B2 (en) Data analysis device, data analysis method, and program.
JP2009080681A (en) Program structure parsing method and device
Neukirchen et al. Quality assurance for TTCN‐3 test specifications
JP4698943B2 (en) Program production method, program production apparatus, program automatic conversion method, and program

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant