Method and converter for converting high level language to other high level languages

A high-level language and converter technology, applied in the field of data processing, can solve the problems of users being impatient, the source language and target language are different, the target language is not readable and maintainable, etc., to achieve a clear format and easy to use. Effect

Inactive Publication Date: 2009-08-05
BEIJING HOLLYSYS
View PDF0 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The disadvantage of this approach is that: since users want to report as many errors as possible in the source language, how to modify them, if only one error can be reported at a time, users will easily become impatient; in addition, the source language and the target language have different properties, especially details, if the generated target language is not readable and maintainable, it will be difficult to find the difference in the details and solve the problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and converter for converting high level language to other high level languages
  • Method and converter for converting high level language to other high level languages
  • Method and converter for converting high level language to other high level languages

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0053] Embodiment 1, a high-level language converter, its position in the whole system is as follows figure 1 shown; used to convert the source language to the target language description.

[0054] In this embodiment, the source language ST is a structured programming language for industrial control specified by IEC61131-3, similar to the PASCAL language, which is currently one of the international general industrial control programming standard languages; the target language is well known The C language, which is widely supported by the processor industry, can easily obtain C compilers for various platforms. The source language and target language used for conversion in practical applications are not limited to this embodiment.

[0055] The high-level language converter is as figure 2 As shown, it includes: a lexical analysis device, a syntax analysis device, a semantic analysis device and a target language generation device.

[0056] The lexical analysis device is used t...

Embodiment 2

[0162] Embodiment 2. A method for converting a high-level language into other high-level languages, said method comprising the following steps:

[0163] A. According to the ASCII code sequence output by the source language editor, generate ASCII sequence combinations with attributes one by one, and proceed to step B;

[0164] B, according to source language grammatical structure, obtain LR (1) analysis table by the described ASCII sequence combination with attribute, generate grammatical analysis tree, carry out step C;

[0165] C. Verify the validity of the syntax analysis tree, and proceed to step D after the verification is qualified;

[0166] D. Generate an equivalent target language description with readability and maintainability according to the verified syntax analysis tree; end.

[0167] In this embodiment, step D specifically includes:

[0168] Perform post-order traversal on the verified parse tree, and generate the target language description corresponding to eac...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and a converter for converting a high-level language to another high-level language. The converter comprises: an lexical analysis device, analysis device syntax, semantic analysis device, the target language generating devices; target language to generate the device tree after parsing traversal, according to the preservation of the source language syntax tree analysis of different types of nodes and the target language to describe relationship between the fragment to generate parsing tree corresponding to each node of the target language to describe fragments generated by the target language together constitute a description of the target language fragment described; when the target language to describe fragment generated when, according to the preservation of each target language to describe the relationship between the level of the target language to identify the various levels described in the target language to describe the left to add the corresponding number of specific characters. The invention can be converted into a standardized, formatted with the readability and maintainability of the target language to describe.

Description

technical field [0001] The invention relates to the field of data processing, in particular to a method and a converter for converting a high-level language into other high-level languages. Background technique [0002] Industrial control algorithm configuration software involves a problem: to convert the five standard languages ​​in IEC61131-3 (hereinafter referred to as IEC language) into machine instructions that can be recognized by the processor. This process is called compilation, and the process of completing this process is Modules are called compilers. IEC61131-3 stipulates five languages, and each language requires a specific compiler to complete this process; in general, each processor has a different architecture and instruction set, so the compiler is also required There are different backends in order to generate instruction sequences for different processors. Therefore, it is a complicated process to realize the compiler of IEC five languages, and this proce...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/45
Inventor 施波赵雅囡刘金龙王沿海
Owner BEIJING HOLLYSYS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products