KR960012418B1 - Chill case code - Google Patents

Chill case code Download PDF

Info

Publication number
KR960012418B1
KR960012418B1 KR1019930026130A KR930026130A KR960012418B1 KR 960012418 B1 KR960012418 B1 KR 960012418B1 KR 1019930026130 A KR1019930026130 A KR 1019930026130A KR 930026130 A KR930026130 A KR 930026130A KR 960012418 B1 KR960012418 B1 KR 960012418B1
Authority
KR
South Korea
Prior art keywords
case
label
value
code
labels
Prior art date
Application number
KR1019930026130A
Other languages
Korean (ko)
Other versions
KR950022611A (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 KR1019930026130A priority Critical patent/KR960012418B1/en
Publication of KR950022611A publication Critical patent/KR950022611A/en
Application granted granted Critical
Publication of KR960012418B1 publication Critical patent/KR960012418B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/22Arrangements for supervision, monitoring or testing

Landscapes

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

Abstract

A device using the method has a hardware having a main memory board(101), a CPU(102), an auxiliary memory unit(104), an input/output unit(105), and an UNIX operating unit(103). The method comprises the steps of; examining an input case label number by using a case label value or case selector value(201,202), examining a certain number of label number(203,205), performing stop after code generation, label value sorting and vector table organizing, or examining label dividing possibility(205,209), organizing a vector table, generating and finishing a dividing vector code(210,214), and generating and finishing a code generation by using organizing balance binary scale tree.

Description

칠 케이스 구조의 코드생성방법How to Generate Code for Chill Case Structure

제1도는 본 발명이 적용되는 하드웨어 블록 구성도.1 is a hardware block diagram to which the present invention is applied.

제2도는 본 발명에 따른 코드 생성 방법에 대한 전체 처리 흐름도.2 is an overall processing flow diagram for a code generation method according to the present invention.

제3도는 케이스 레이블 테이블 분리 가능성 조사 과정의 상세 흐름도.3 is a detailed flowchart of the case label table separability investigation process.

제4도는 분리 클러스터 리스트를 구성하기 위한 부프로그램 스플리트(SPLIT)의 상세 처리 흐름도.4 is a detailed processing flowchart of a subprogram split (SPLIT) for constructing a separate cluster list.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

101 : 메인 메모리 102 : 중앙처리보드101: main memory 102: central processing board

103 : 범용 운용체제 104 : 보조기억장치103: general purpose operating system 104: auxiliary storage device

105 : 입/출력 장치 106 : 시스템 버스105: input / output device 106: system bus

본 발명은 CCITT가 권고한 교환기용 프로그램 언어인 칠(CHILL : CCITT High Level Language)언어의 케이스 구조의 코드생성 방법에 관한 것이다.The present invention relates to a method for generating code of a case structure of a CHILL (CCITT High Level Language) language, which is a programming language for the exchange recommended by CCITT.

기존의 컴파일러들은 케이스 구조의 코드 생성시 케이스 레이블의 값의 분포를 몇 가지 종류로 분류하고, 각 종류에 대하여 코드를 생성하는 방식을 취한다. 분류된 종류에 따라 if-then-else 코드, 벡터 코드, 해싱 함수 및 해싱 테이블을 이용한 코드등을 이용하여 비교적 효율적으로 코드를 생성하고 있다. 그러나 기존의 컴파일러는 케이스 레이블의 분포가 효율적인 코드를 생성할 수 있는 분포임에도 불구하고도 이를 처리하지 못하는 경우가 있어, 기존 레이블의 분류 종류만으로는 효율적인 케이스 구조의 코드를 생성할 수 없다.Existing compilers classify the distribution of case label values into several types and generate code for each type when generating the case structure code. According to the classified type, codes are generated relatively efficiently by using if-then-else codes, vector codes, hashing functions, and codes using hashing tables. However, the existing compiler may not handle this even though the distribution of the case label is a distribution capable of generating efficient code. Therefore, the classification type of the existing label cannot generate the efficient case structure code.

교환기 프로그램은 다중 프로세스간에 송/수신되는 다양한 메시지에 의하여 동기적으로 동작이 이루어지기 때문에 프로그램의 전체 구조가 케이스 구조를 기반으로 구성되어 있다.Since the exchange program is operated synchronously by various messages transmitted / received among multiple processes, the overall structure of the program is composed based on the case structure.

따라서, 프로그램에서 사용하는 송/수신 메시지의 종류가 많아지면 많아질수록, 수신 메시지를 처리하기 위한 루틴으로 가기 위하여 많은 비교가 이루어지므로 프로그램의 수행 속도가 저하된다. 이러한 이유로 교환기 프로그램과 같은 영구 내장형 프로그램들에 있어 케이스 구조의 효율적 코드 생성에 의한 수행 속도의 향상은 전체 시스템의 성능 향상에 영향을 주므로 절대적으로 중요하다.Therefore, as the number of types of transmission / reception messages used in the program increases, many comparisons are made in order to go to a routine for processing the received message. For this reason, in the case of permanent embedded programs such as the exchange program, the improvement of the execution speed by efficient code generation of the case structure is absolutely important because it affects the performance of the entire system.

따라서, 상기 종래 기술에 대한 제반 문제점을 해결하기 위하여 안출된 본 발명은, 케이스 레이블의 분포가 효율적인 코드 생성을 할 수 있는 분포임에 착안하여 효율적인 코드로 생성하는 방법을 제공하는데 그 목적이 있다.Accordingly, an object of the present invention is to provide a method of generating an efficient code based on the fact that the distribution of a case label is a distribution capable of efficient code generation.

상기의 목적을 달성하기 위하여 본 발명은, 메인 메모리 보드, 중앙처리장치, 보조기억장치, 입/출력 장치, 및 UNIX 운영체제부를 구비한 하드웨어에 적용되는 칠 케이스(CHILL CASE) 구조의 코드생성 방법에 있어서, 케이스 레이블(L)값 및 케이스 셀렉터 값을 읽어 입력된 케이스 레이블의 숫자가 4 미만인가를 조사하는 제1단계; 상기 제1단계 수행 후, 케이스 레이블의 숫자가 설정 갯수 미만이면 순차 비교 코드를 생성하고 설정갯수 이상이면 레이블간의 최대 편차가 레이블 개수의 설정배수를 초과하는가의 여부를 조사하는 제2단계; 상기 제2단계 수행 후, 설정배수를 초과하지 않는 경우, 케이스 벡터 코드를 생성하고 레이블 값을 소팅하여 벡터 테이블을 구성하고 벡터 코드 생성 후 종료하고, 설정배수를 초과하는 경우, 레이블의 분리 가능성을 조사하는 제3단계; 상기 제3단계 수행 후, 분리 가능하면 분리된 케이스 벡터 테이블을 구성하고 이를 이용하여 분리 벡터 코드를 생성하고 종료하는 제4단계; 상기 제3단계 수행 후, 케이스 레이블 테이블이 분리 가능하지 않는 경우, 레이블의 개수가 임의치를 초과하는지를 검사하여 레이블의 개수가 임의치를 초과하지 않는 경우, 순차 비교 코드로 생성한 후 종료하고 레이블의 개수가 임의치를 초과하면 밸런스 이진 트리를 구성하여 코드 생성 후 종료하는 제5단계; 를 포함하여 이루어지는 것을 특징으로 한다.In order to achieve the above object, the present invention relates to a code generation method of a chill case structure applied to hardware including a main memory board, a central processing unit, an auxiliary memory device, an input / output device, and a UNIX operating system. The method of claim 1, further comprising: reading a case label (L) value and a case selector value and checking whether the number of the input case label is less than four; A second step of generating a sequential comparison code if the number of case labels is less than a set number after performing the first step; and checking whether the maximum deviation between labels exceeds a set multiple of the number of labels if the number of the case labels is less than the set number; After performing the second step, if the set multiple is not exceeded, the case vector code is generated and the label value is sorted to construct the vector table, and the vector code is generated and terminated. A third step of investigation; A fourth step of constructing a separate case vector table and performing generation of the separated vector code by using the separated case vector table after performing the third step; If the case label table is not separable after performing the third step, it is checked whether the number of labels exceeds an arbitrary value, and if the number of labels does not exceed an arbitrary value, after generating with a sequential comparison code, the process ends and ends. A fifth step of constructing a balanced binary tree and ending after code generation when is greater than an arbitrary value; Characterized in that comprises a.

이하, 첨부된 도면을 참조하여 본 발명의 일실시예를 상세히 설명한다.Hereinafter, with reference to the accompanying drawings will be described an embodiment of the present invention;

제1도는 본 발명이 적용되는 하드웨어의 블록 구성도로서, 도면에서 101은 메인 메모리, 102는 중앙처리보드, 103은 UNIX 운영체제부, 104는 보조기억장치, 105는 입출력 장치를 각각 나타낸다.FIG. 1 is a block diagram of hardware to which the present invention is applied. In the drawings, reference numeral 101 denotes a main memory, 102 a central processing board, 103 a UNIX operating system unit, 104 an auxiliary memory device, and 105 an input / output device, respectively.

도면에 도시한 각 블록들의 기능을 살펴보면 다음과 같다.Looking at the function of each block shown in the drawings as follows.

메인 메모리(101)는 케이스 제어구조를 갖는 실행화일이 탑재되는 보드이고, 중앙처리보드(102)는 상기 메인 메모리(101)에 탑재된 화일을 수행시키는 보드이다. 그리고, 보조기억장치(104)는 화일 및 데이터 등을 저장하는 장치로 메인 메모리에 탑재되지 않는 화일과 도구들이 저장된다.The main memory 101 is a board on which an execution file having a case control structure is mounted, and the central processing board 102 is a board for executing a file mounted on the main memory 101. In addition, the auxiliary memory device 104 is a device for storing files and data, and stores files and tools not mounted in the main memory.

입/출력 장치(105)는 분리 컴파일 수행에 필요한 화일 및 테이터, 수행중에 발생하는 모든 오류 메시지를 입/출력하는 장치이다.The input / output device 105 is a device for inputting / outputting files and data necessary for performing a separate compilation and all error messages generated during the execution.

UNIX 운영체제부(103)는 상기의 보드 및 장치를 제어하며, 각 보드 및 장치간에 주고받는 메시지는 시스템 버스(106)를 통해 이루어진다.The UNIX operating system unit 103 controls the boards and devices, and messages exchanged between the boards and devices are made through the system bus 106.

제2도는 본 발명에 따른 전체 처리 흐름도로서, 케이스 구조의 레이블 값 및 셀렉터(selector) 값을 읽어서 최소한의 비교만을 수행하여 케이스 셀렉터(case selector) 값과 일치하는 루틴으로 찾아가는 효과적인 케이스 구조 코드 생성하는 절차를 보여준다.2 is a flow diagram of the overall process according to the present invention, which reads the label value and the selector value of the case structure and performs only a minimal comparison to generate an effective case structure code that goes to a routine matching the case selector value. Show the procedure.

먼저, 케이스 레이블(L) 값을 읽는데, 이 단계는 케이스 구조의 코드 생성을 효율적으로 생성하기 위한 준비단계로서 상기 보조기억장치(104)에 저장되어 있는 케이스 구조가 포함된 화일을 상기 메인 메모리(101)로 로딩을 하고 이 화일로부터 케이스 레이블 값 및 셀렉터 값을 읽는다.(201).First, a case label (L) value is read. This step is a preparation step for efficiently generating code generation of a case structure. The file including the case structure stored in the auxiliary memory device 104 is stored in the main memory (L). 101) and read the case label value and selector value from this file (201).

그 다음은, 입력된 케이스 레이블의 숫자가 4 미만인가를 조사하여(202) 조사결과 4 미만인 경우, 케이스 레이블의 값과 케이스 셀렉터 값을 순차적으로 비교하여 값이 일치하는 레이블의 다음 실행문부터 수행할 수 있도록 순차 비교코드를 생성한 후, 케이스 구조 코드생성을 완전히 종료한다(203).Next, if the number of input case labels is less than 4 (202), and if the result of the investigation is less than 4, the value of the case label and the case selector value are sequentially compared to the next execution statement of the label having the same value. After generating the sequential comparison code, the case structure code generation is completely terminated (203).

상기 조사(202) 결과 케이스 레이블 숫자가 4 이상인 경우, 케이스 레이블 값의 밀집도를 측정하기 위하여, 입력된 케이스 레이블 값들 중에서 최대값 max(L), 최소값 min(L), 이들간의 차이 R을 계산한다.(204).When the case label number is 4 or more, the maximum value max (L), minimum value min (L), and the difference R between them are calculated from the case label values. (204).

그 다음은 케이스 레이블의 최대값과 최소값의 차이 R이 레이블 개수의 3배를 초과하는가의 여부를 조사하는데(205), 여기서는 케이스 레이블 값의 최대 편차를 조사함으로 코드의 효율성이 가장 높은 벡터 코드를 사용할 것인지를 결정한다.Next, we examine whether the difference R between the maximum value and the minimum value of the case label exceeds three times the number of labels (205). Here, the maximum deviation of the case label value is examined to find the most efficient vector code. Decide if you want to use it.

케이스 레이블의 최대값과 최소값의 차이가 레이블 개수의 3배 이하인 경우, 케이스 벡터 테이블을 구성한다(206). 여기서, 벡터 코드 생성을 위하여 입력된 레이블과 해당 실행문의 시작 번지를 쌍으로 하는 벡터 테이블을 구성한다. 먼저, 입력된 레이블을 소팅한 후 레이블 값과 점프 번지를 저장하기 위하여 레이블의 최대 편차 개수만큼의 크기를 갖는 벡터 테이블을 할당한다. 그 다음, 레이블 값과 해당 실행문 점프 번지를 소팅된 순서대로 순차적으로 벡터 테이블에 등록하는데, 인접한 레이블간에 값의 차이가 있는 경우, 값의 차이만큼 레이블 값은 -1로, 점프 번지는 케이스 구조의 종료번지로 할당하여 인접한 레이블 사이에 등록한다.If the difference between the maximum value and the minimum value of the case label is less than or equal to three times the number of labels, the case vector table is configured (206). Here, a vector table is formed by pairing the input label and the start address of the execution statement for generating the vector code. First, after sorting the input label, a vector table having a size corresponding to the maximum deviation number of the label is allocated to store the label value and the jump address. Then, the label value and the corresponding statement jump address are sequentially registered in the vector table in the sorted order. If there is a difference between the adjacent labels, the label value is -1 by the difference of the values, and the jump address is the case structure. Assign as the end address of and register between adjacent labels.

그 다음, 벡터 테이블을 이용하여 벡터 테이블의 원소(array element)수만큼의 벡터 코드를 생성하고 종료한다(207). 먼저, 입력된 레이블에 해당하는 실행문의 코드를 생성한 후, 케이스 셀렉터 값과 일하는 케이스 레이블을 찾는데 소요되는 평균비교횟수가 1인 가장 효율적인 코드이지만, 벡터 테이블을 구성시 불필요한 기억장소의 낭비를 감수하여야 한다.Next, the number of vector codes corresponding to the number of array elements of the vector table is generated using the vector table, and the process ends (207). First, after generating the code of the execution statement corresponding to the input label, it is the most efficient code with the average comparison count of 1 to find the case selector value and the working case label, but it takes unnecessary storage waste when constructing the vector table. shall.

케이스 레이블의 최대값과 최소값의 차이가 레이블 개수의 3배를 초과하는 경우, 레이블의 분리 가능성을 조사한다(208). 이 단계는 레이블의 값들이 하나의 클러스터(cluster)로 밀집되어 분포하지 않기 때문에 하나의 벡터 테이블을 이용하여 코드를 생성하지 못하였지만, 그 값들이 적은 수의 클러스터(cluster)로 밀집되어 분포하는가를 조사하여 분리 벡터 테이블(split vector table)을 이용한 벡터 코드로 생성할 것인지 여부를 조사한다. 여기서, 케이스 레이블 테이블이 분리 가능한 경우, 레이블 테이블을 클러스터(cluster) 단위로 분리하고 분리한 클러스터(cluster)를 리스트로 구성하여 클러스터(cluster_Ptr)가 포인트하도록 한다.If the difference between the maximum value and the minimum value of the case label exceeds three times the number of labels, the possibility of label separation is examined (208). This step does not generate code using a vector table because the values of the labels are not clustered and distributed, but the values are clustered and distributed in a small number of clusters. Investigate whether to generate vector code using a split vector table. Here, when the case label table is separable, the label table is divided into cluster units and the separated clusters are configured as a list so that the cluster clusterPtr points.

그 다음은 전 단계(208)에서 검사하였던 분리 가능성에 대한 결과(cluster_Ptr의 값)를 가지고 분리 코드 생성 과정으로 갈 것인지 밸런스(balanced) 이진 트리를 이용하는 코드 생성 단계로 갈 것인지를 결정한다. 클러스터(Cluster_Ptr)의 값이 널(NULL)이면 분리가 안된 경우이고 그 값이 널(NULL)이 아니면 분리가 된 것을 의미한다.The next step is to decide whether to go to the separation code generation process or the code generation step using a balanced binary tree with the result of the separation possibility (step of cluster_Ptr) checked in the previous step (208). If the value of the cluster (Cluster_Ptr) is null, it means that there is no separation. If the value of the cluster (Pluster_Ptr) is not null, it means that it is separated.

그 다음은, 생성한 클러스터(cluster) 테이블 리스트를 이용하여 분리 케이스 벡터 테이블을 구성한다(210). 여기서, 분리 벡터 코드를 생성하며 코드 생성시, 생성된 벡터 테이블 리스트를 포인트하는 포인터(SVT_Ptr)에 첫 번째 벡터 테이블의 주소를 치환한(211) 후, 이 포인터의 값이 널(NULL)이 아닐때까지 분리 벡터 코드를 생성하고(212, 213), 포인터 값을 현재 지시하고 있는 벡터 테이블에 연결되어 있는 다음 테이블의 주소로 치환한다(214). 포인터(SVT_PTR)의 값이 널(NULL)이 되면 코드 모든 생성을 완전히 종료한다(212).Next, a separate case vector table is constructed using the generated cluster table list (210). Here, after generating the separated vector code and replacing the address of the first vector table with the pointer SVT_Ptr that points to the generated vector table list (211), the value of the pointer is not null. Until the separated vector code is generated (212, 213), the pointer value is replaced with the address of the next table connected to the vector table currently indicated (214). When the value of the pointer SVT_PTR is null, all generation of the code is completely terminated (212).

상기 과정(209) 결과 케이스 레이블 테이블이 분리 가능하지 않는 경우, 레이블의 개수가 8을 초과하는지를 검사한다(215). 여기서는, 케이스 구조의 코드 생성시 어떤 코드 패턴을 선택할 것인지를 결정한다. 레이블의 개수가 8을 초과하지 않는 경우, 순차 비교 코드로 생성한(216) 후 모든 코드생성을 완전히 종료한다. 순차 비교 코드는 평균 비교횟수가 (n+1)/2로 레이블의 숫자가 증가하면 증가할 수록 비교 횟수가 선형적으로 증가하지만, 레이블의 개수가 8을 초과하지 않는 경우에는 다른 코드에 비해 뒤떨어지지 않는다.If the case label table is not detachable as a result of step 209, it is checked whether the number of labels exceeds 8 (215). Here, it is decided which code pattern to select when generating the code of the case structure. If the number of labels does not exceed 8, all codes are completely generated after generating 216 with sequential comparison codes. The sequential comparison code increases the number of comparisons linearly as the number of labels increases as the average number of comparisons is (n + 1) / 2. However, if the number of labels does not exceed 8, it is compared with other codes. Does not fall

상기 과정(215)의 결과 레이블의 개수가 8을 초과하는 경우, 상기 과정(208)에서 소팅한 레이블 테이블을 이용하여 밸런스(balanced) 이진 트리를 구성한다(217). 여기서는, 이진 검색 방법으로 코드를 생성할 수 있도록 밸런스(balanced) 이진 트리를 준비하는 단계이다.If the number of the resulting labels in step 215 exceeds 8, a balanced binary tree is constructed using the label table sorted in step 208 (step 217). In this case, a balanced binary tree is prepared so that a code can be generated by a binary search method.

그 다음에, 전 단계에서(217) 생성한 밸런스(balanced) 이진 트리를 이용하여 케이스 셀렉터(case selector) 값을 찾는 코드를 생성한(218) 후 모든 생성을 완전히 종료한다. 여기서, n개의 레이블을 갖는 케이스 구조 코드 생성시, 레이블의 숫자가 많아져도 비교 횟수가 선형적으로 증가하지 않는, 평균 비교 횟수 O(log n)인 효율적인 코드를 생성한다.Next, using the balanced binary tree generated in the previous step (217), a code for finding a case selector value is generated (218), and then all generations are completed. Here, when generating a case structure code having n labels, an efficient code having an average number of comparisons O (log n) is generated in which the number of comparisons does not increase linearly even if the number of labels increases.

제3도는 케이스 레이블 테이블 분리 가능성 조사 과정의 상세 흐름도로서, 케이스 레이블의 분리 여부를 결정하고 분리 가능한 경우, 케이스 레이블을 클러스터(cluster) 단위로 분리하고 이를 리스트로 구성하는 절차를 보여준다.3 is a detailed flowchart of the case label table separability investigation process, which shows a procedure of determining whether to separate case labels and separating case labels in a cluster unit and forming a list if possible.

먼저, 케이스 레이블 테이블의 값들을 오름차순으로 소팅한다(301). 이 단계는 케이스 레이블 값들이 어떠한 상태로 분포하는가를 확인하기 위한 준비 단계이다.First, the values of the case label table are sorted in ascending order (301). This step is a preparatory step to determine in what state the case label values are distributed.

그 다음에, 클러스터 리스트를 포인트하기 위한 포인터 클러스터(cluster_Ptr) 값을 널(NULL)로 치환한다(302). 이 단계는 케이스 레이블들의 분리 여부를 검사하기 전에는 분리된 것이 없음을 나타낸다. 만약, 분리 여부에 대한 검사가 종료된 후에도 이 포인터의 값이 널(NULL)이면 케이스 레이블이 분리되지 않았음을 나타낸다.Next, the pointer cluster (cluster_Ptr) value for pointing to the cluster list is replaced with null (302). This step indicates that there is no separation until the case labels are examined for separation. If the value of this pointer is null even after checking for separation, the case label is not separated.

그 다음에, 케이스 레이블 테이블, 케이스 레이블의 최대값을 매개변수로하여 레이블이 클러스터(cluster)로 밀집되어 분포하는가를 검사하는 부프로그램 스플리트(SPLIT)를 호출한다(303). 이 단계 종료후 전역 변수로 선언된(global variable) 클러스터(cluster) 리스트 포인터(cluster_Pt)의 값이 널(NULL)이면 레이블들이 클러스터(cluster)로 분리 되지 않았음을 나타내고, 널(NULL)이 아니면 레이블이 클러스터(cluster)로 분리되었음을 나타내며, 그 값은 분리된 클러스터(cluster) 테이블 리스트를 포인트하는 포인터 값이다.Subsequently, a subprogram split (SPLIT) is called (303) which checks whether the labels are clustered and distributed using the maximum value of the case label table and the case label as parameters. After the end of this step, if the value of the global variable cluster list pointer (cluster_Pt) is null, it indicates that the labels were not separated into clusters. Indicates that the label is separated into clusters, the value of which is a pointer value that points to a separate list of cluster tables.

제4도는 케이스 레이블을 클러스터로 분리하여, 분리 클러스터 리스트를 구성하기 위한 부프로그램 스플리트(SPLIT)의 상세 흐름도이다.4 is a detailed flowchart of a subprogram split (SPLIT) for dividing a case label into clusters to form a separate cluster list.

먼저, 분리 클러스터(cluster)리스트를 구성하기 위한 함수 스플리트(SPLIT)가 호출되면 케이스 레이블 테이블(VT), 레이블의 최대값(max) 및 최소값(min)을 매개변수로 넘겨받는다(401). 이 단계는 스플리트(SPLIT)함수가 호출될 때 함수의 수행이 시작되는 단계로, 호출자로부터 매개변수 값을 넘겨받는다.First, when a function split SPLIT for constructing a separate cluster list is called, a case label table VT, a maximum value (max) and a minimum value (min) of a label are passed as parameters (401). This step starts the execution of the function when the SPLIT function is called. It takes parameter values from the caller.

그 다음에, 넘겨받은 레이블의 최대값(max)과 최소값(min)이 일치하는가를 검사한다(402). 이 단계는 더 이상 분리를 할 것인지 아닌지를 결정하는 단계이다.Then, it is checked whether the maximum value (max) and the minimum value (min) of the received label match (402). This step is to decide whether or not to separate.

전 단계(402)의 결과 최대값(max)과 최소값(min)이 일치하면, 함수 스플리트(SPLIT)의 수행을 종료한다. 이 단계는 스플리트 함수의 호출이 종료되는 단계이다.When the maximum value max and the minimum value min of the previous step 402 coincide, the execution of the function split SPLIT ends. This step ends the call to the split function.

과정(402)의 결과 최대값(max)과 최소값(min)이 일치하지 않는 경우, 새로운 중간값(mid), 중간값(mid)과 최소값(min)간의 값의 차이 R1과 갯수 N1, 최대값(max)과 최소값(min)+1간의 차이 R2와 갯수 N2를 계산한다(403).If the resultant maximum value (max) and minimum value (min) do not coincide with the result of the process 402, the difference between the new median value mid, the mid value mid and the minimum value min R1, the number N1, the maximum value Compute the difference R2 and the number N2 between (max) and the minimum value (min) +1 (403).

상기 과정(403)에서 계산한 값 R1이 3×N1을 초과하는지의 여부를 계산한다(404). 이 단계는 최소값(min)과 중간값(mid) 사이의 레이블 값들로 클러스터(cluster) 테이블을 구성할 것인지 결정하는 단계이다.It is calculated whether the value R1 calculated in the step 403 exceeds 3 x N1 (404). This step decides whether to construct a cluster table with label values between the minimum and mid values.

상기 과정(404)에서 R1이 3×N1을 초과하면 R2가 3×N2를 초과하는지를 계산한다(405). 이 단계는, 중간값(mid)+1, 최대값(max)을 가지고 클러스터(cluster) 테이블 구성을 위한 함수 스플리트(SPLIT)를 각각 재귀적으로 호출한다(412).In step 404, if R1 exceeds 3xN1, it is calculated whether R2 exceeds 3xN2 (405). This step recursively invokes a function split (SPLIT) for cluster table construction with a mid value mid + 1 and a max value, respectively (412).

그러나 과정(405)에서 R2가 3×N2를초과하지 않는 경우, 중간값(mid)+1과 최대값(max) 사이의 레이블을 포함하는 새로운 클러스터(cluster) 테이블을 구성하고 이 테이블을 클러스터(cluster) 테이블 리스트에 등록한(406) 후, 케이스 레이블 테이블, 최소값(min)과 중간값(mid)을 매개변수로 하여 함수 스플리트(SPLIT)를 재귀적으로 호출한다(407).However, if in step 405 R2 does not exceed 3 x N2, we construct a new cluster table containing a label between mid + 1 and max (max), After registering in the table list (406), the function split (SPLIT) is recursively called (407) using the case label table, the minimum value (min) and the middle value (mid) as parameters.

상기 과정(404) 결과 R1이 3×N1 이하인 경우, R2가 3×N2 이하인지 계산한다(408). 이 단계는, 최소값(min)과 중간값(mid)사이의 레이블 값 들로 클러스터(cluster) 테이블로 구성한다는 조건하에서, 중간값(mid)+1과 최대값(max) 사이의 레이블 값들도 클러스터(cluster) 테이블로 구성할 것인지를 결정하는 단계이다.If R1 is less than or equal to 3 × N1 as a result of the process 404, it is calculated whether R2 is less than or equal to 3 × N2 (408). In this step, the label values between the mid value (mid) + 1 and the maximum value (max) are also clustered under the condition that the cluster table is composed of the label values between the minimum value (min) and the mid value (mid). This step decides whether to configure (cluster) table.

상기 과정(408)에서, R2가 3×N2 이하인 경우, 최소값(min)과 중간값(mid) 사이의 값과 중간값(mid+1) 과 최대값(max) 사이의 값을 각각 포함하는 두 개의 새로운 클러스터(cluster) 테이블을 구성하고, 이를 클러스터(cluster) 테이블 리스트에 등록한(417) 후, 호출된 스플리트(SPLIT) 함수의 수행을 종료시킨다.In the process 408, when R2 is less than or equal to 3 x N2, two values each include a value between the minimum value (min) and the middle value (mid) and a value between the middle value (mid + 1) and the maximum value (max), respectively. The new cluster tables are configured, registered in the cluster table list (417), and the execution of the called split function is terminated.

상기 과정(408)의 결과 R2가 3×N2를 초과하면 최소값(min)과 중간값(mid) 사이의 레이블 값을 포함하는 새로운 클러스터(cluster) 테이블을 구성하고, 이를 클러스터(cluster) 테이블 리스트에 등록한(409) 후, 케이스 레이블 테이블, 중간값(mid)+1과 최대값(max)을 매개변수로 하여 함수 스플리트(SPLIT)를 재귀적으로 호출하고 종료한다(410).As a result of the process 408, if R2 exceeds 3 × N2, a new cluster table including a label value between the minimum value (min) and the mid value (mid) is formed, and this is added to the cluster table list. After registration (409), the function split (SPLIT) is recursively called and terminated with the case label table, the middle value mid + 1 and the maximum value max as a parameter (410).

상기와 같은 처리 절차로 이루어진 본 발명은 운영체제의 도움을 받으며 중앙처리보드(102) 상에서 수행되는 컴파일러가 칠 케이스(CHILL case) 구조의 코드를 생성할 때 기존의 상용화된 컴파일러가 생성하는 케이스 코드보다 비교 횟수가 적은 케이스 구조 뿐만 아니라 다른 고급 언어(high level language)의 케이스 구조 코드 생성에도 적용되어 효율적인 코드를 생성할 수 있다.The present invention composed of the above-described processing procedure is supported by the operating system and when the compiler running on the central processing board 102 generates a chill case (CHILL case) structure code than the case code generated by the conventional commercialized compiler In addition to the case structure with fewer comparisons, it is applied to case structure code generation of other high level languages to generate efficient code.

Claims (3)

메인 메모리 보드(101), 중앙처리장치(102), 보조기억장치(104), 입/출력 장치(105), 및 UNIX 운영체제부(103)를 구비한 하드웨어에 적용되는 칠 케이스(CHILL CASE) 구조의 코드생성 방법에 있어서, 케이스 레이블(L) 값 및 케이스 셀렉터 값을 읽어 입력된 케이스 레이블의 숫자가 4 미만인가를 조사하는 제1단계(201, 202); 상기 제1단계(201, 202) 수행 후, 케이스 레이블의 숫자가 설정 개수 미만이면 순차 비교 코드를 생성하고 설정갯수 이상이면 레이블간의 최대 편차가 레이블 개수의 설정배수를 초과하는가의 여부를 조사하는 제2단계(203 내지 205); 상기제2 단계(203 내지 205)수행 후, 설정배수를 초과하지 않는 경우 케이스 벡터 코드를 생성하고 레이블 값을 소팅하여 벡터 테이블을 구성하고 벡터 코드 생성 후 종료하고 설정배수를 초과하는 경우, 레이블의 분리 가능성을 조사하는 제3단계(205 내지 209); 상기 제3단계(205 내지 209)수행 후, 분리 가능하면 분리된 케이스 벡터 테이블을 구성하고 이를 이용하여 분리 벡터 코드를 생성하고 종료하는 제4단계(210 내지 214); 상기 제3단계(205 내지 209) 수행 후, 케이스 레이블 테이블이 분리 가능하지 않는 경우, 레이블의 개수가 임의치를 초과하는지를 검사하여 레이블의 개수가 임의치를 초과하지 않는 경우, 순차 비교 코드로 생성한 후 종료하고 레이블의 개수가 임의치를 초과하면 밸런스 이진 트리를 구성하여 코드 생성 후 종료하는 제5단계(215 내지 218); 를 포함하여 이루어지는 것을 특징으로 하는 칠 케이스(CHILL CSAE) 구조의 코드 생성 방법.CHILL CASE structure applied to hardware having a main memory board 101, a central processing unit 102, an auxiliary memory 104, an input / output device 105, and a UNIX operating system unit 103. A method of generating a code, the method comprising: a first step (201, 202) of reading a case label (L) value and a case selector value and checking whether the number of input case labels is less than four; After performing the first steps 201 and 202, if the number of case labels is less than the set number, a sequential comparison code is generated. Two steps (203 to 205); After performing the second step (203 to 205), if the set times are not exceeded, the case vector code is generated and the label values are sorted to construct the vector table, and after the vector codes are generated and the set times are exceeded, A third step (205 to 209) of investigating the possibility of separation; A fourth step (210 to 214) of constructing a separate case vector table if possible, and generating and terminating a separate vector code using the same, after performing the third step (205 to 209); After performing the third step (205 to 209), if the case label table is not separable, it is checked whether the number of labels exceeds an arbitrary value, and if the number of labels does not exceed an arbitrary value, after generating the sequential comparison code A fifth step (215 to 218) of ending a code generation by constructing a balanced binary tree when the number of labels exceeds an arbitrary value; Code generation method of the chill case (CHILL CSAE) structure, characterized in that comprises a. 제1항에 있어서, 상기 제3단계(205 내지 209)의 케이스 레이블 테이블 분리 가능성을 조사하는 방법은, 케이스 레이블 테이블의 값들을 오름 차순으로 소팅하는 제1과정(310); 포인트 클러스터(cluster_Ptr) 값을 널(NULL)로 치환하는 제2과정(302); 케이스 레이블 테이블, 케이스 레이블의 최대값을 매개변수로 하여 부프로그램 스플리트를 호출하고 종료하는 제3과정(303); 을 포함하여 이루어지는 것을 특징으로 하는 칠 케이스(CHILL CASE) 구조의 코드생성 방법.The method of claim 1, wherein the method for checking the case label table detachability of the third step (205 to 209) comprises: a first process (310) for sorting values of the case label table in ascending order; A second step 302 of replacing a point cluster (cluster_Ptr) value with null; A third step 303 of calling and terminating the subprogram split by using the case label table and the maximum value of the case label as parameters; Code generation method of the chill case (CHILL CASE) structure, characterized in that comprises a. 제2항에 있어서, 상기 제3과정(303)은, 함수 스플리트가 호출되면 레이블의 최대값(max)과 최소값(min)이 일치하는가를 검사하는 과정(401, 402); 상기 과정(401, 402) 수행 후, 최대값(max)과 최소값(min)이 일치하면 종료하고 일치하지 않는 경우, 새로운 중간값(mid)과 최소값(min)간의 값의 차이 R1과 개수 N1, 최대값(max)과 최소값(min)+1간의 차이 R2와 개수 N2를 계산하여 R1이 3×N1을 초과하는지의 여부를 조사하는 과정(403, 404); 상기 과정(403, 404) 수행 후 R1이 3×N1을 초과하면 R2가 3×N2를 초과하는지를 조사하여 R2가 3×N2를 초과하지 않는 경우, 중간값(mid)+1과 최대값(max) 사이의 레이블을 포함하는 새로운 클러스터 테이블을 구성하여 리스트에 등록한 후, 함수 스플리트를 호출하는 과정(405 내지 407); 상기 과정(403, 404) 수행 후, R1이 3×N1 이하인 경우 R2가 3×N2 이하인지 조사하여 R2가 3×N2이하인 경우, 새로운 클러스터 테이블을 구성하고, 리스트에 등록한 후, 호출된 스플리트 함수의 수행을 종료시키고 R2가 3×N2를 초과할 경우의 클러스터 테이블을 구성하고, 테이블 리스트에 등록하여 함수 스플리트를 호출하고 종료하는 과정(409, 410); 을 포함하여 이루어지는 것을 특징으로 하는 칠 케이스(CHILL CASE) 구조의 코드 생성방법.3. The method of claim 2, wherein the third process (303) comprises: (401, 402) checking whether the maximum value (max) and the minimum value (min) of the label match when the function split is called; After performing the processes 401 and 402, if the maximum value max and the minimum value min coincide, the process is terminated. If not, the difference between the new intermediate value mid and the minimum value min R1 and the number N1, Calculating whether or not R1 exceeds 3 x N1 by calculating the difference R2 and the number N2 between the maximum value max and the minimum value min + 1 (403, 404); When R1 exceeds 3 × N1 after performing the processes 403 and 404, it is examined whether R2 exceeds 3 × N2. When R2 does not exceed 3 × N2, the median mid + 1 and the maximum value max Constructing a new cluster table including a label between < RTI ID = 0.0 >) < / RTI > and registering it in the list, and then calling the function split (405 to 407); After performing steps 403 and 404, if R1 is 3 × N1 or less, check whether R2 is 3 × N2 or less, and if R2 is 3 × N2 or less, construct a new cluster table, register it in the list, and then call split Terminating the execution of the function and constructing a cluster table when R2 exceeds 3 × N2, registering in the table list, calling and terminating the function split (409, 410); Code generation method of the chill case (CHILL CASE) structure, characterized in that comprises a.
KR1019930026130A 1993-12-01 1993-12-01 Chill case code KR960012418B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019930026130A KR960012418B1 (en) 1993-12-01 1993-12-01 Chill case code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019930026130A KR960012418B1 (en) 1993-12-01 1993-12-01 Chill case code

Publications (2)

Publication Number Publication Date
KR950022611A KR950022611A (en) 1995-07-28
KR960012418B1 true KR960012418B1 (en) 1996-09-20

Family

ID=19369631

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019930026130A KR960012418B1 (en) 1993-12-01 1993-12-01 Chill case code

Country Status (1)

Country Link
KR (1) KR960012418B1 (en)

Also Published As

Publication number Publication date
KR950022611A (en) 1995-07-28

Similar Documents

Publication Publication Date Title
EP0561541B1 (en) A method of processing a program by parallel processing, and a processing unit thereof
US5043880A (en) Data flow processor which combines packets having same identification and destination and synchronizes loop variables for detecting processing loop termination
US20130014092A1 (en) Multi level virtual function tables
US5339420A (en) Partitioning case statements for optimal execution performance
EP0755002A2 (en) Language processor and language processing method to generate object programs by compiling source programs
US10445095B2 (en) Information processing device, compiler method, and recording medium recording compiler program
US5276821A (en) Operation assignment method and apparatus therefor
KR960012418B1 (en) Chill case code
CN111966383A (en) Quantitative analysis method, system and medium for operating system kernel compatibility
WO2010095004A1 (en) Priority search trees
Nethravathi et al. Improved Parallel Scanner for the Concurrent Execution of Lexical Analysis Tasks on Multi-Core Systems
CN114168469A (en) Coverage rate analysis method and system based on database management system fuzzy test
CN113946516A (en) Code coverage rate determining method and device and storage medium
CN113190497B (en) Task processing method of reconfigurable processor and reconfigurable processor
CN110825453A (en) Data processing method and device based on big data platform
CN112131016A (en) Application program internal data processing method, device and equipment
US5535132A (en) Variable sequence determining method for a dichotomy determination graph
JPH09288580A (en) Device and method for optimizing source program
WO1992003782A1 (en) Parsing program data streams
CN112612471B (en) Code processing method, device, equipment and storage medium
CN114328595B (en) Data query method and device, electronic equipment and storage medium
CN115580571B (en) Message sending method, device, computing equipment and storage medium
CN113535637B (en) Operation acceleration unit and operation method thereof
CN118034924A (en) Data processing method and device based on many-core system, electronic equipment and medium
CN117852456A (en) Simulation method, electronic device, and computer-readable medium

Legal Events

Date Code Title Description
A201 Request for examination
N231 Notification of change of applicant
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20040831

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee