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

Analysis method and device of interpreted language and computer system

An interpreted language and computer system technology, which is applied in the field of an interpreted language parsing method and its device and computer system, can solve the problems that code interpretation and execution cannot satisfy immediacy, reduced interpretation efficiency, and dependent parsing, etc. Will crash, instant code parsing, resource saving effect

Active Publication Date: 2017-05-31
CTRIP TRAVEL NETWORK TECH SHANGHAI0
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the analysis process of the existing interpreted language, other language tools are often used to analyze, translate, execute, and then return the result, which reduces the efficiency of interpretation, and relies heavily on the analysis of the language by the language tool, resulting in interpretation The parsing of type language is not universal
[0004] In addition, the analysis of the existing interpreted language can only work on the entire code block, and the interpretation and execution of the code cannot meet the requirement of immediacy

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
  • Analysis method and device of interpreted language and computer system
  • Analysis method and device of interpreted language and computer system
  • Analysis method and device of interpreted language and computer system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] Such as figure 1 As shown, the interpreted language analysis device of this embodiment includes an editor interface 1, a syntax enhancement unit 11, a code conversion unit 2, a hash calculation unit 21, and a parser 3, wherein the syntax enhancement unit is integrated in the editor interface 1 , the hash calculation unit 21 is integrated in the code conversion unit 2 .

[0047] In this embodiment, the editor interface 1 is used to obtain the code P, and the grammar enhancement unit 11 is used to add a label symbol "()" to each minimum lexical unit in the code P, wherein the label can use any symbol, as long as the minimum grammar can be identified Units are sufficient, and are not limited to the symbols selected in this embodiment.

[0048] When the editor interface 1 obtains the trigger notification, the code conversion unit 2 converts the code P into a multi-tree A according to the label symbol "()". The trigger notification in this embodiment is carriage return or ...

Embodiment 2

[0078] The computer system in this embodiment includes two processes A and B, both of which call the parsing process of the interpreted language described in Embodiment 1.

[0079] In this embodiment, the two processes A and B are mutually locked, and the process A is in the working state, and the process B is in the dormant state. If the process A crashes, the process B will wake up and replace the crashed process A to execute the parsing process of the interpreted language.

[0080] At the same time, the system will automatically clean up the resources of the crashed process A, and create a new dormant process C, which is mutually locked with process B.

[0081] That is, the pair of processes that lock each other. One is responsible for execution, and the other is responsible for monitoring (waking up during sleep). When the working process crashes, the sleeping process immediately replaces it and cleans up unnecessary resources. At the same time, a new process is started t...

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 an analysis method and device of an interpreted language and a computer system. The analysis method of the interpreted language comprises the steps of adding a label to each minimal lexical element of an obtained code; when detecting a trigger notification, converting the code into a multi-branched tree on the basis of the label in the code; and reversely and recursively traversing the multi-branched tree. The analysis device of the interpreted language comprises an editor interface, a grammar enhancement unit, a code conversion unit and a resolver, wherein the grammar enhancement unit is used for adding the label to each minimal lexical element of the code obtained by the editor interface; the code conversion unit is used for converting the code into the multi-branched tree on the basis of the label in the code when the editor interface receives the trigger notification; and the resolver is used for reversely and recursively traversing the multi-branched tree. According to the invention, language analysis is independent of other languages and tools, and common use and self-analysis of the interpreted language and interpretation and execution of increments are achieved.

Description

technical field [0001] The invention relates to a language analysis method and its device, in particular to an interpreted language analysis method, its device and a computer system. Background technique [0002] Compared with the existence of compiled languages, the source code is not directly translated into machine language, but first translated into intermediate code, and then the interpreter interprets and runs the intermediate code. For example, Python / JavaScript / Perl / Shell are all interpreted languages ​​​​in computer programming languages. [0003] In the analysis process of the existing interpreted language, other language tools are often used to analyze, translate, execute, and then return the result, which reduces the efficiency of interpretation, and relies heavily on the analysis of the language by the language tool, resulting in interpretation Type language parsing is not universal. [0004] In addition, the analysis of the existing interpreted language can o...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/455
Inventor 桂之明郭亮陆费汉平
Owner CTRIP TRAVEL NETWORK TECH SHANGHAI0
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