JPH01175035A - Multi-language processing converter - Google Patents

Multi-language processing converter

Info

Publication number
JPH01175035A
JPH01175035A JP33224387A JP33224387A JPH01175035A JP H01175035 A JPH01175035 A JP H01175035A JP 33224387 A JP33224387 A JP 33224387A JP 33224387 A JP33224387 A JP 33224387A JP H01175035 A JPH01175035 A JP H01175035A
Authority
JP
Japan
Prior art keywords
language
text
analysis
conversion
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP33224387A
Other languages
Japanese (ja)
Inventor
Hitoshi Kimura
均 木村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP33224387A priority Critical patent/JPH01175035A/en
Publication of JPH01175035A publication Critical patent/JPH01175035A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To execute program conversion among many languages through an assembling text in a common state by loading an analysis module and a formation module previously formed in accordance with conversion specifying parameters (converting language and converted language). CONSTITUTION:An analyzing part 3 executes the character/phrase analysis, syntax analysis and meaning analysis of an inputted source program and forms a decomposing text 6. A conversion part 4 executes conversion processing independent of the language of an object to be converted by inputting the text 6 and executing the conversion processing on the basis of the key information of a dictionary file 7 and forms an assembling text in a so-called common format. A forming part 5 inputs the test 8, executes name formation, data formation and syntax formation processing and forms a converted source program.

Description

【発明の詳細な説明】 〔概要〕 多言語間のプログラムの変換を行う多言語処理コンバー
タに関し、 言語毎に解析モジュールと生成モジュールとを予め作成
しておき、指示された言語に対応するモジュールを夫々
ロードして共通のインターフェースを介して異なる任意
の言語に変換を行うことを目的とし、 指示された言語に対応する解析モジュールがロードされ
、入力されたプログラムから分解テキストを生成する解
析部と、この分解テキストから辞書ファイルを参照して
組み立てテキストを生成する変換部と、この組み立てテ
キストがら、指示された言語に対応する生成モジュール
がロードされて対応するプロラEを生成する生成部とを
備え、入力されたプログラムを指示された言語のプログ
ラムに変換して出力するように構成する。
[Detailed Description of the Invention] [Summary] Regarding a multilingual processing converter that converts programs between multiple languages, an analysis module and a generation module are created in advance for each language, and a module corresponding to the specified language is created. an analysis module that loads an analysis module corresponding to the specified language and generates a decomposed text from the input program; A conversion unit that generates an assembled text from this disassembled text by referring to a dictionary file, and a generation unit that loads a generation module corresponding to an instructed language from this assembled text and generates a corresponding prora E, It is configured to convert an input program into a program in a specified language and output it.

(産業上の利用分野〕 本発明は、多言語間のプログラムの変換を行う多言語処
理コンバータに関するものである。
(Field of Industrial Application) The present invention relates to a multilingual processing converter that converts programs between multiple languages.

〔従来の技術と発明が解決しようとする問題点〕異なる
プログラム言語をソース変換する場合、第3図に示すよ
うに、変換元の言語と、変換先の言語とを意識したソー
スコンバータを夫々専用に開発しなければならない。こ
のため、変換対象の言語が変われば、ソースコンバータ
を作J[すか、または新規に開発しなければならず、多
種にわたるプログラム言語のソースコンバータを開発す
るために大規模な開発工数が必要になってしまうという
問題点があった。
[Problems to be solved by the conventional technology and the invention] When converting sources from different programming languages, as shown in Figure 3, source converters are dedicated to the source language and destination language, respectively. must be developed. Therefore, if the language to be converted changes, a source converter must be created or a new one must be developed, which requires a large amount of development man-hours to develop source converters for a wide variety of programming languages. There was a problem with this.

本発明は、言語毎に解析モジュールと生成モジエールと
を予め作成しておき、指示された言語に対応するモジュ
ールを夫々ロードして共通のインターフェースを介して
異なる任意の言語に変換を行うことを目的としている。
The purpose of the present invention is to create an analysis module and a generation module for each language in advance, load the modules corresponding to the designated languages, and perform conversion into any different language via a common interface. It is said that

〔問題点を解決するための手段〕[Means for solving problems]

第1図を参照して問題点を解決するための手段を説明す
る。
Means for solving the problem will be explained with reference to FIG.

第1図において、解析部3は、指示された言語に対応す
る解析モジュールがロードされ、入力されたプログラム
から分解テキスト6を生成するものである。
In FIG. 1, the analysis section 3 is loaded with an analysis module corresponding to the designated language and generates decomposed text 6 from the input program.

変換部4は、辞書ファイル7を参照して、分解テキスト
6から変換対象の言語に依存しない共通化した態様(イ
ンターフェース)の組み立てテキスト8を生成するもの
である。
The converter 4 refers to the dictionary file 7 and generates an assembled text 8 from the decomposed text 6 in a standardized format (interface) that does not depend on the language to be converted.

生成部5は、指示された言語に対応する生成モジュール
がロードされ、共通化した態様の組み立てテキスト8か
ら指示された言語のブログラノ、を生成するものである
The generation unit 5 is loaded with a generation module corresponding to the specified language, and generates a blog in the specified language from the assembled text 8 in a standardized manner.

〔作用〕[Effect]

本発明は、第1図に示すように、指示された解析モジュ
ールのロードされた解析部3は、人力されたプログラム
を解析して分解テキスト6を生成し、変換部4が辞書フ
ァイル7を参照してこの分解テキスト6から共通化した
fi様の組み立てテキスト8を生成し、指示された生成
モジュールのロードされた生成部5がこの徂み立てテキ
スト8から指示された言語のプログラムを生成するよう
にしている。
In the present invention, as shown in FIG. 1, an analysis section 3 loaded with an instructed analysis module analyzes a human-powered program to generate a decomposed text 6, and a conversion section 4 refers to a dictionary file 7. Then, a common fi-like assembly text 8 is generated from this disassembled text 6, and the generation unit 5 loaded with the instructed generation module generates a program in the specified language from this advanced text 8. I have to.

従って、種々の言語に対応した解析モジエールおよび生
成モジュールを予め作成しておき、指示された言語に対
応するモジュールをロードし、いわば共通化した態様の
組み立てテキスト8を経由して指示された言語のプログ
ラムに変換することにより、任意の言語間のプログラム
の変換を容易に行うことが可能となる。
Therefore, analysis modules and generation modules corresponding to various languages are created in advance, the module corresponding to the specified language is loaded, and the specified language is created via the assembly text 8 in a standardized manner. By converting the program into a program, it becomes possible to easily convert the program between arbitrary languages.

〔実施例〕〔Example〕

次に、第1図および第2図を用いて本発明の1実施例の
構成および動作を順次詳細に説明する。
Next, the configuration and operation of one embodiment of the present invention will be explained in detail using FIGS. 1 and 2.

第1図において、ソースコンバータ1は、制御部2、解
析部3、変換部4、および生成部5から構成され、入力
されたソースプログラムを他の言語のソースプログラム
に変換するものである。
In FIG. 1, a source converter 1 includes a control section 2, an analysis section 3, a conversion section 4, and a generation section 5, and converts an input source program into a source program in another language.

制御部2は、異なるシステノ、環境下で動作rるように
各種制御を行うものである。例えば変+A Jet示パ
ラメータ(変換元の言語、変換先の言語、例えばA言語
→C言語など)を解析し°ζ、該当j゛る解析モジュー
ルおよび生成モジュールをロードしてこれに制御を渡す
ものである。
The control unit 2 performs various controls so that the system operates under different systems and environments. For example, a variable + A Jet that analyzes the indicated parameters (source language, destination language, e.g. A language → C language, etc.), loads the corresponding analysis module and generation module, and passes control to them. It is.

解析部3は、入力されたソースプログラムの字句解析、
構文解析、意味解析を行い、分解テキスト6を生成する
ものである。これは、ソースプログラムを記述した言語
毎に記述形式やデータの用途や意味が異なるので、字句
解析、構文解析、意味解析をセットにしたモジュールを
図中点線を用いた矩形で囲んだようにA言語用解析モジ
ュール3−1、B言語解析モジ1−ル3−2、・・・N
言語解析モジュール3−Nとして予めHE Oi# L
、ておき、指示された変換元の言語に対応するいずれか
をその都度ロードして使用するようにしている。
The analysis unit 3 performs lexical analysis of the input source program,
It performs syntactic analysis and semantic analysis to generate decomposed text 6. This is because the description format, data usage, and meaning differ depending on the language in which the source program is written, so the module that includes lexical analysis, syntactic analysis, and semantic analysis is shown in A as shown in the dotted rectangle in the figure. Language analysis module 3-1, B language analysis module 1-2,...N
HE Oi# L in advance as language analysis module 3-N
, and load and use the one corresponding to the specified conversion source language each time.

変換部4は、変換対象の言語に依存しないで変換処理を
行うようにしたものであって、分解テキスト6を人力と
して、辞書ファイル7のキー情(μを基に変換処理を行
い、いわば共通化した態様の組み立てテキスト8を生成
するものである。
The conversion unit 4 is designed to perform conversion processing independent of the language to be converted, and uses the decomposed text 6 as human power to perform conversion processing based on the key information (μ) of the dictionary file 7, so to speak. This is to generate an assembled text 8 in a converted form.

生成部5は、組み立てテキスト8を入力として、名前生
成、データ生成、構文生成処理を行い、変換後のソース
プログラムを生成するものである。
The generation unit 5 receives the assembled text 8 as input, performs name generation, data generation, and syntax generation processing, and generates a converted source program.

これは、変換しようとするソースプログラムの言語毎に
記述形式やデータの用途や意味が異なるので、名前生成
、データ生成、構文生成をセットにしたモジュールを図
中点線を用いた矩形で囲んだようにA言語用生成モジュ
ール5−1、B言語生成モジュール5−2、・・・N言
語生成モジュール5−Nとして予め準備しておき、指示
された変換先の言語に対応するいずれかをその都度ロー
ドして使用するようにしている。
This is because the description format, data usage, and meaning differ depending on the language of the source program to be converted, so the module that includes name generation, data generation, and syntax generation is enclosed in a rectangle using dotted lines in the figure. A language generation module 5-1, B language generation module 5-2, . I try to load it and use it.

次に、第1図図中■ないし■を用いて、A言語からC言
語に変換する動作を説明する。
Next, the operation of converting the A language into the C language will be explained using symbols 1 to 2 in FIG.

第1図において、図中■は、変換指示パラメータとして
“A言語からC言語に変換”する旨がソースコンバータ
1を構成する制御部2に対して、入力されたことを示す
、これにより、制御部2は、解析部3に対してA言語用
解析モジュール3−1をロードすると共に、生成部5に
対してC言語用生成モジュール5−3をロードする。
In FIG. 1, ■ in the figure indicates that "conversion from A language to C language" has been input to the control unit 2 constituting the source converter 1 as a conversion instruction parameter. The unit 2 loads the A language analysis module 3-1 into the analysis unit 3, and loads the C language generation module 5-3 into the generation unit 5.

図中■は、A言語のソースプロラムを解析部3に入力す
ることを示す。
In the figure, ■ indicates that the source program in language A is input to the analysis section 3.

図中■は、解析部3にロードされて制御の渡されたへ言
語用解析モジエール3−1が、入力されたA言語のソー
スプログラムの字句解析、構文解析、および意味解析を
行い、分解テキスト6を生成してファイルに出力するこ
とを示す。
In the figure, ■ indicates that the language analysis module 3-1, which has been loaded into the analysis unit 3 and given control, performs lexical analysis, syntactic analysis, and semantic analysis of the input A language source program and decomposes the text. 6 is generated and output to a file.

図中■は、分解テキスト6を変換部4に入力することを
示す。
In the figure, ■ indicates that the decomposed text 6 is input to the converter 4.

図中■は、変換部4が辞書ファイル7から読み込んだキ
ー情報を基に、変換処理を行い、いわば共通化した態様
の組み立てテキスト8を生成することを示す。
In the figure, ■ indicates that the conversion unit 4 performs a conversion process based on the key information read from the dictionary file 7, and generates the assembled text 8 in a so-called common form.

図中■は、この生成した組み立てテキスト8をファイル
に出力することを示す。
■ in the figure indicates that the generated assembled text 8 is output to a file.

図中■は、組み立てテキスト8を生成部5に入力するこ
とを示す。
In the figure, ■ indicates that the assembled text 8 is input to the generation unit 5.

図中■は、C言語用生成モジュール5−3が、組み立て
テキスト8を入力として、名前生成、データ生成、構文
生成して作成したC言語のソースプログラムをファイル
に出力することを示す。
In the figure, ■ indicates that the C language generation module 5-3 takes the assembled text 8 as input, generates a name, generates data, generates a syntax, and outputs a C language source program created to a file.

以上のように、変換指示パラメータ(変換元の言語、変
換先の言語)に対応して予め作成しておいた解析モジエ
ールおよび生成モジュールをロードし、いわば共通化し
た態様の組み立てテキスト8を介して異なる言語に変換
することにより、多言語間のソースコンバートを容易に
行うことが可能となる。
As described above, the analysis module and generation module created in advance corresponding to the conversion instruction parameters (conversion source language, conversion destination language) are loaded, and the assembly text 8 in a standardized manner is used. By converting to a different language, source conversion between multiple languages can be easily performed.

次に、第2図を用いてFTL (富士通独自の言語)か
らC0BOLに変換する場合について具体的に説明する
Next, the case of converting from FTL (Fujitsu's original language) to C0BOL will be specifically explained using FIG.

FTLとして左端に記述したソースプログラム例えば“
データ名I  FLD  n  TYPEj”なるソー
スプログラムは、第1図解析部3にロードされたFTL
用解析モジエールによって、図示分解テキスト6−1が
生成される。この分解テキスト6−1は、図示のように
、NAMEテキスト、データ定義テキス!・、データの
型テキスト、レベルテキストなどがから構成されている
。これらの各テキストに対応する矩形で囲んだ中に記述
した“データ名10、′FLD′などは、F TLソー
スブー゛lグラムが字句解析、構文解析、意味解析して
求めたものである。これらの“データ名1”などは、各
テキストから夫々ポイントされている。
For example, the source program written as FTL on the left side is “
The source program with the data name “I FLD n TYPEj” is the FTL loaded into the analysis unit 3 in Figure 1.
The illustrated decomposition text 6-1 is generated by the analysis module. This decomposed text 6-1 includes NAME text, data definition text!, as shown in the figure.・It consists of data type text, level text, etc. The "data name 10", 'FLD', etc. written in the rectangles corresponding to each of these texts are obtained by the FTL source program through lexical analysis, syntactic analysis, and semantic analysis. "Data name 1" and the like are each pointed to from each text.

組み立てテ;トス)8−1は、第1図変換部4によって
110処1ヱされたものである。これは、図中点線の矢
印を用いて示したように、各テキストに対応づけて共通
化した態様の組み立てテキストに変1i処理したもので
ある。
The assembly test (toss) 8-1 is the result of the conversion at 110 and 1 by the converting section 4 in FIG. As shown by the dotted line arrows in the figure, this is a modified text 1i that is made to correspond to each text in a common manner.

右端に示す“On データ名I  PICTUREN(
1)、  “ (先頭の“O“は数字の零)は、第り図
生成部5にロードされたC OB OL用生成モジュー
ルによって、生成されたC0n0Lで記述されたソース
プログラムである。これは、C0n0L用生成モジユー
ルが、組み立てテキスト8−1を入力として、名前生成
、データ生成、構文生成を行って、生成したものである
“On data name I PICTUREN (
1), “(The leading “O” is a number zero) is a source program written in C0n0L generated by the COB OL generation module loaded into the diagram generation unit 5. , the C0n0L generation module receives the assembled text 8-1 as input and generates a name, data, and syntax.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば、言語に対応した
解析モジュールおよび生成モジュールを予め作成して準
備し、変換指示パラメータ中の変換元および変換先の言
語に対応した解析モジュールおよび生成モジュールを夫
々ロードして言語に依存しない共通化した態様で変換後
のプログラムを作成する構成を採用しているため、多言
語間のプログラムの変換を容易に行うことができる。こ
れにより、従来の変換対象の言語毎に必要であった専用
のソースコンバータを開発するための工数が削減される
As explained above, according to the present invention, analysis modules and generation modules corresponding to languages are created and prepared in advance, and analysis modules and generation modules corresponding to the conversion source and conversion destination languages in the conversion instruction parameters are created and prepared in advance. Since a configuration is adopted in which a converted program is created in a common manner independent of languages by loading each language, programs can be easily converted between multiple languages. This reduces the number of man-hours required to develop a dedicated source converter for each language to be converted.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の1実施例構成および動作説明図、第2
図は本発明を適用した変換例、第3図は従来技術の説明
図を示す。 図中、lはソースコンバータ、2は制御部、3は解析部
、3−1ないし3−Nは解析モジュール、4は変換部、
5は生成部、5−1ないし5−Nは生成モジュール、6
は分解テキスト、7は辞書ファイル、8は組み立てテキ
ス・トを表す。 45校4訂敷ハ゛ラメ9(A官官)=>011合)「 本づ56月の1 突〃し弔11楕〃露およP1カイ午゛
説−明口兜  ]  1 図4交尤の1薯合                 
   変への1語卓〔](主え 多せTの ηζβ月 
謁見 3 図
FIG. 1 is an explanatory diagram of the configuration and operation of one embodiment of the present invention, and FIG.
The figure shows an example of conversion to which the present invention is applied, and FIG. 3 shows an explanatory diagram of the prior art. In the figure, l is a source converter, 2 is a control unit, 3 is an analysis unit, 3-1 to 3-N are analysis modules, 4 is a conversion unit,
5 is a generation unit, 5-1 to 5-N are generation modules, 6
7 represents the disassembled text, 7 represents the dictionary file, and 8 represents the assembled text. 45th school 4th edition Shijiharame 9 (A government official) => 011 go) `` Book 1 of the 56th month Sudden funeral 11 oval and P1 Kaipo theory - Mingguchi Kabuto ] 1 Figure 4 Intersection 1 piece
One word table for strange [] (mainly TaseT's ηζβ month
audience 3 diagram

Claims (1)

【特許請求の範囲】 多言語間のプログラムの変換を行う多言語処理コンバー
タにおいて、 指示された言語に対応する解析モジュールがロードされ
、入力されたプログラムから分解テキスト(6)を生成
する解析部(3)と、 この分解テキスト(6)から、辞書ファイル(7)を参
照して組み立てテキスト(8)を生成する変換部(4)
と、この組み立てテキスト(8)から、指示された言語
に対応する生成モジュールがロードされて対応するプロ
グラムを生成する生成部(5)とを備え、入力されたプ
ログラムを指示された言語のプログラムに変換して出力
するように構成したことを特徴とする多言語処理コンバ
ータ。
[Claims] In a multilingual processing converter that converts a program between multiple languages, an analysis module corresponding to the designated language is loaded, and an analysis unit (6) that generates decomposed text (6) from the input program is loaded. 3), and a conversion unit (4) that generates an assembled text (8) from this decomposed text (6) by referring to a dictionary file (7).
and a generation unit (5) that loads a generation module corresponding to the specified language from the assembly text (8) and generates a corresponding program, and converts the input program into a program of the specified language. A multilingual processing converter characterized by being configured to convert and output.
JP33224387A 1987-12-29 1987-12-29 Multi-language processing converter Pending JPH01175035A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33224387A JPH01175035A (en) 1987-12-29 1987-12-29 Multi-language processing converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33224387A JPH01175035A (en) 1987-12-29 1987-12-29 Multi-language processing converter

Publications (1)

Publication Number Publication Date
JPH01175035A true JPH01175035A (en) 1989-07-11

Family

ID=18252777

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33224387A Pending JPH01175035A (en) 1987-12-29 1987-12-29 Multi-language processing converter

Country Status (1)

Country Link
JP (1) JPH01175035A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
JP2008146637A (en) * 2006-11-20 2008-06-26 Intentional Software Corp Domain transformation languages
JP5942018B1 (en) * 2015-06-23 2016-06-29 株式会社エクサ Source code conversion program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
JP2008146637A (en) * 2006-11-20 2008-06-26 Intentional Software Corp Domain transformation languages
JP5942018B1 (en) * 2015-06-23 2016-06-29 株式会社エクサ Source code conversion program

Similar Documents

Publication Publication Date Title
Hendrix LIFER: A natural language interface facility
JPS59197965A (en) Literary style converting system
JPH01175035A (en) Multi-language processing converter
Rico et al. Lemonade: A web assistant for creating and debugging ontology lexica
US5805888A (en) Identifier dictionary-generating device
JPH04286029A (en) Source program converter
JPH0689166A (en) Parts processing description expanding system
Weigelt et al. How to Prepare an API for Programming in Natural Language.
Aladjev et al. Functional and procedural programming in Mathematica
JPS6190272A (en) Translation system using dictionary function
JPH0293731A (en) Language converter generating device
JPS6068403A (en) Robot programming device
JPH041852A (en) Mechanical translation device
JPH03222069A (en) Machine translation device
JPH0528185A (en) Natural language processing interface
Benaddy et al. A programming language for matrices operations and LATEX code generation
KR20200079702A (en) Service package authoring method and robot service development system
Johnson et al. Formal syntax methods for natural language
Boszahin Combinatory logic and natural language parsing
Gropp et al. Platon: Dialog Management and Rapid Prototyping for Multilingual Multi-user Dialog Systems
Banik Extending a surface realizer to generate coherent discourse
JPS6051950A (en) Program outputting system
JPS60134335A (en) Printing method of source program
JPH0512329A (en) Machine translation system
Khin IMPLEMENTATION OF NATURAL LANGUAGE TRANSLATION SYSTEM BASED ON NLP: MYANMAR TO JAPAN TRANSLATION PROCESS