US 10,891,117 B2
Method and system for using subroutine graphs for formal language processing
Loring G. Craymer, III, Temple City, CA (US)
Filed by Loring G. Craymer, III, Temple City, CA (US)
Filed on Feb. 14, 2020, as Appl. No. 16/790,896.
Claims priority of provisional application 62/807,704, filed on Feb. 19, 2019.
Prior Publication US 2020/0264852 A1, Aug. 20, 2020
Int. Cl. G06F 9/44 (2018.01); G06F 8/41 (2018.01)
CPC G06F 8/425 (2013.01) 21 Claims
OG exemplary drawing
 
1. A method for processing subroutine-structured graph-based intermediate representations during formal language processing implemented by a computing device, the method comprising:
classifying a set of subroutines identified in an intermediate representation of code from a source file or set of object files according to mutually recursive relationships between subroutines in the set of subroutines;
recording the mutually recursive relationships in a set of subroutine record data structures;
labeling relevant nodes in the intermediate representation or tokens from the intermediate representation to track the mutually recursive relationships;
constructing a set of graph representations including a graph representation for each subroutine in the set of subroutines;
analyzing a graph of the intermediate representation that is decomposed into subroutine graphs from the set of graph representations by serialization through depth-first pre-order graph traversal or path walks through the graph of the intermediate representation, collecting partial positions that distinguish points of action in generated code, where partial positions are tracked in a partial position list of nodes in the intermediate representation that identify points in the graph of the intermediate representation, where each of the nodes is taken from a separate subroutine graph and the list is a backtrace of an invocations that led to a terminal node, and where each node, except a terminal node in the list, references one subroutine from the set of subroutines;
labeling nodes of the graph of the intermediate representation or tokens of the intermediate representation from the partial position lists to enable runtime tracking in the generated code so that associated actions are executed at associated places in the generated code;
generating a subsequent intermediate representation by serialization of the graph of the intermediate representation through pre-order depth-first traversal; and
creating the generated code from the intermediate representation.