Unlock instant, AI-driven research and patent intelligence for your innovation.

Language variable detection method and device

A variable and language technology, applied in the field of language variable detection, can solve problems such as low variable detection efficiency, and achieve the effect of solving low variable detection efficiency and improving efficiency

Active Publication Date: 2019-02-26
TENCENT TECH (SHENZHEN) CO LTD
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] Embodiments of the present invention provide a language variable detection method and device to at least solve the technical problem of low efficiency of language variable detection in the related art

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
  • Language variable detection method and device
  • Language variable detection method and device
  • Language variable detection method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] According to an embodiment of the present invention, an embodiment of a language variable detection method is provided.

[0032] Optionally, in this embodiment, the variable detection method of the above language can be applied as figure 1 In the hardware environment constituted by the server 102 and the terminal 104 as shown. figure 1 is a schematic diagram of the hardware environment of the language variable detection method according to the embodiment of the present invention. Such as figure 1 As shown, the server 102 is connected to the terminal 104 through a network. The above-mentioned network includes but not limited to: a wide area network, a metropolitan area network or a local area network. The terminal 104 is not limited to a PC, a mobile phone, a tablet computer, and the like. The language variable detection method in the embodiment of the present invention may be executed by the server 102 , may also be executed by the terminal 104 , and may also be execu...

Embodiment 2

[0140] The technical solutions of the present invention will be described below in conjunction with preferred embodiments.

[0141] In this embodiment, because lua supports hot loading, lua is generally used as the scripting language in the background of the game. A typical error that often occurs during the use of lua is the uninitialized use of lua variables, because the uninitialized use of variables will only find this error when a crash occurs at runtime, and for games that use a lot of lua code, by running It is obviously very time-consuming to correct errors, which reduces the efficiency of variable detection and affects the need to seek other solutions.

[0142] This embodiment detects uninitialized use of variables in lua code through static analysis, reports uninitialized variables, and can give developers a warning, thereby repairing all such errors at one time, and greatly saving development time. The static analysis detection method traverses the abstract syntax ...

Embodiment 3

[0180] According to an embodiment of the present invention, a language variable detection device for implementing the above language variable detection method is also provided. Figure 11 is a schematic diagram of a language variable detection device according to an embodiment of the present invention. Such as Figure 11 As shown, the device may include: a first acquisition unit 10 , a second acquisition unit 20 , a slice analysis unit 30 and a first determination unit 40 .

[0181] The first obtaining unit 10 is configured to obtain target variables in the target source code of the scripting language.

[0182] The second acquiring unit 20 is configured to acquire the dependency relationship of the target variable, wherein the dependency relationship is used to represent the relationship between the defined variable and the used variable in the target variable.

[0183] The slice analysis unit 30 is configured to perform slice analysis on the target sentence to which the tar...

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 provides a language variable detection method and device. The method comprises the steps of acquiring target variables in target source codes of a script language; acquiring a dependency relationship of the target variables, wherein the dependency relationship is used for representing the relationship between defined variables and use variables in the target variables; performing slice analysis on target statements to which the target variables belong according to the dependency relationship to obtain target conditions of the target variables, wherein the target conditions are used for restrain the target variables as non-assigned variables; when obtaining solving results meeting the target conditions for the target variables, determining that the target variables as non-initialized variables. The method and the device solve the technical problem of low efficiency of language variable detection in relevant technology.

Description

technical field [0001] The invention relates to the field of computers, in particular to a language variable detection method and device. Background technique [0002] In the existing language variable detection technology, the technical scheme of detecting the uninitialized use of C language variables is adopted, and the uninitialized variables can be analyzed by using symbol tables, abstract syntax trees, and control flow charts. Among them, the symbol table is a data structure used in the language translator. In the symbol table, each identifier in the program source code is bound with its declaration or usage information, such as data type, scope, and memory address. The tree structure corresponding to the abstract syntax tree, the control flow chart expresses the transformation and transmission process of information in the problem in a graphical way, and is a combination of various concepts related to the data flow, using decomposition and abstract means to control th...

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 Patents(China)
IPC IPC(8): G06F8/41
CPCG06F8/43
Inventor 王杰
Owner TENCENT TECH (SHENZHEN) CO LTD