Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method making nonlocal skip tool imitated into exception mechanism by C programming language

A non-native, C language technology, used in program control devices, program startup/switching, multi-programming devices, etc., can solve the problem of inability to effectively support error handling, slow development and maintenance of large-scale applications, and difficult to read programs. and other problems, to achieve the effect of easy modification and maintenance, optimization of development speed, and clear code structure

Inactive Publication Date: 2007-04-25
KONKA GROUP
View PDF0 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The C language has a wide range of applications, but it cannot effectively support error handling. Using the existing goto statement for error handling makes the development and maintenance of large-scale applications very slow, and the programs are not easy to read

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
  • A method making nonlocal skip tool imitated into exception mechanism by C programming language
  • A method making nonlocal skip tool imitated into exception mechanism by C programming language

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] The concrete implementation method that realizes the object of the present invention will be described in detail below, but the content of the present invention is not limited to this kind of approach, is not limited to this kind of macro definition, and those who use other implementation methods to realize the object of the present invention will also fall into the patent protection scope of the present invention within.

[0023] The non-local jump tool of C language used in the method of the present invention to simulate an exception mechanism includes setjmp and longjmp, which are used to simulate the try catch exception mechanism of a modern object-oriented language. setjmp and longjmp are basic jump tools, and are the basis of the simulation technology of the present invention. In the C language of the prior art, these two instructions of setjmp and longjmp only complete the jump function between lines, and cannot realize the abnormal flow mechanism processing.

...

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

This invention discloses a method to use C language non local jump tool analogue abnormal mechanism, which comprises the following steps: in each needed jump flow control point using setjmp to record transfer environment; when the transfer function enters next layer flow to keep front layer transfer environment variable; when executing flow jump, transferring non local jump tool to front record transfer environment.

Description

technical field [0001] The invention relates to a computer software method, in particular to an abnormal flow control method proposed for a simple jump method in C language. Background technique [0002] The existing C language, as an ancient language, is commonly used in embedded systems at present. Embedded systems are different from advanced and complex functional devices. In order to achieve the purpose of industrial application, the hardware requirements should be as low as possible. As a powerful and concise language tool, it is widely used in industrial systems, but C language lacks some excellent mechanisms of some modern object-oriented languages. [0003] The flow control mechanism of C language generally realizes the jump by judging the value of the variable, or using the goto statement. These control methods are too simple. When the program is slightly complicated, it will make the program difficult to understand. The goto statement even caused the generation of...

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/44G06F9/48
Inventor 朱克智
Owner KONKA GROUP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products