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

Method and device for parsing source file

A source file and file technology, applied in the field of parsing source files, can solve the problem of easy leakage of source code, and achieve the effect of improving security and readability

Inactive Publication Date: 2015-04-15
FEITIAN TECHNOLOGIES
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The present invention provides a method and device for parsing source files to solve the defect that source codes are easily leaked in the prior 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
  • Method and device for parsing source file
  • Method and device for parsing source file
  • Method and device for parsing source file

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0050] This embodiment provides a method for searching and parsing source files under the source path, such as figure 1 shown, including the following steps:

[0051] Step 101, obtain the source path of the source file and the target path where the target file is located.

[0052] Wherein, the source path is the storage location of the source file, the target file is used to store the parsing result of the source file, and the target path is the storage location of the target file.

[0053] In step 102, it is judged whether the source path exists, and if it exists, execute step 103; otherwise, end the process.

[0054] Step 103, use the source path as the current path, and search for unprocessed objects in the current path.

[0055] Wherein, the object can be a file or a directory.

[0056] Step 104, judging whether an unprocessed object is found, if found, execute step 105; otherwise, execute step 112.

[0057] Step 105, judge whether the found object is a directory, if y...

Embodiment 2

[0318] Such as Figure 14 As shown, it is a structural diagram of a device for parsing source files in this embodiment, including an initialization module 1401, a reading module 1402, a first judgment module 1403, a first update module 1404, a second judgment module 1405, and a first parsing module. module 1406, the second parsing module 1407, the second updating module 1408, the third parsing module 1409, the fourth parsing module 1410 and the writing module 1411, wherein,

[0319] The initialization module 1401 is configured to open the source file, take the initial location of the source file as the current location, and trigger the reading module 1402 .

[0320] The reading module 1402 is configured to read a line of character strings backward from the current position.

[0321] The first judging module 1403 is configured to judge whether the reading module 1402 reads successfully.

[0322] The first updating module 1404 is configured to use the read character string as ...

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 device for parsing a source file. The method comprises the following steps of: A1) opening the source file and using the initial position of the source file as a current position; A2) backwards reading a line of character string from the current position; A3) judging whether the character string is successfully read or not, if so, executing a step A4, and if not, writing contents in a buffer area into an object file; A4) using the line of read character string as a current character string and updating the current position to be a position after and adjacent to the current character string; and A5) judging the current character string, parsing at least one character string including the current character string according to a judgment result, writing a parsing result into the buffer area and returning back to the step A2. The method and the device for parsing the source file have the advantages that since the current servo class library mode is transformed into a concise mode by parsing the source file, the situation that source codes are directly displayed to a user is avoided and the security and the readability of the source file are improved.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method and device for parsing source files. Background technique [0002] In the prior art, a Java program running on a Java virtual machine includes a loaded class file and a loaded dynamic library. When running a Java program, you need to have a class file and a corresponding source file with a .java extension to view the servo class library. [0003] In the process of realizing the present invention, the inventor finds that the prior art has at least the following defects: [0004] In the prior art, the source files displayed to the user are usually source codes, and the security of the source files cannot be guaranteed. Contents of the invention [0005] The invention provides a method and device for parsing source files to solve the defect that source codes are easily leaked in the prior art. [0006] The invention provides a method for parsing source files, compris...

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): G06F17/30
Inventor 陆舟于华章
Owner FEITIAN TECHNOLOGIES
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