Patent Document ID: 9116714
Application ID: 14256678

Base Claim:
1. A method for file processing implemented by a software compiler stored in a non-transitory storage medium, the method comprising: scanning a source file and identifying a target code block based on a preset filtering condition; generating a first abstract syntax tree (AST) reflecting a structure of the target code block_and identifying a plugin position in the target code block using the first AST; inserting a plugin code into the first AST based on the plugin position, wherein the plugin code is used to monitor resources consumed by the target code block; generating a second AST reflecting a structure of the target code block after the plugin code has been inserted; using a write-back interface to write the second AST into the source file; and invoking a complier interface to compile the source file with the plugin codes produced by the write-back interface into executable files, wherein executing the executable files realizes functions of the target code block and functions of the plugin code such that information about the resources consumed by the target code block is obtained; and wherein when receiving a request from a user, the source file with the plugin codes produced by the write-back interface is further modified by the user.

---

Claim 2:
2. The method according to claim 1 , wherein identifying the plugin position in the target code further comprises: analyzing syntax of the target code block and generating the first AST reflecting the structure of the target code block based on the analysis; scanning the first AST and identifying a plugin position on the first AST that corresponds to a function entry and exit position in the target code block; and identifying the plugin position in the target code block based on the plugin position identified on the first AST.