This invention discloses a cross-language function location method for a
code editor based on a hierarchical context-driven approach. Using an
interpreted language as the source language and a
compiled language as the target language, it parses the
dependency tree and
abstract syntax tree of the source language project to collect source variable tracing information at the module, function, and instance levels, constructing a tracing table. A hierarchical mapping rule base is built, and combined with the tracing table, a mapping relationship and confidence level between source variable types and target variable types are established. The file preloading context and intermediate
instruction sequence of the source language are obtained. After incremental
simulation execution, the multi-dimensional call context during cross-language calls is captured, the polymorphism
parsing priority is determined, and the mapped target function is matched. Then, the
source code path and line number of the target function in the target language
source code are used to achieve precise
jumping in the
code editor. Simultaneously, the source variable type tracing chain is displayed at the target function, improving the accuracy and efficiency of locating polymorphic functions in cross-language functions.