Patent Document ID: 9372846
Application ID: 14547793

Base Claim:
1. A method for an abstract syntax tree (AST) builder, the method comprising: (a) utilizing an input string based on a document being analyzed; (b) launching a recognizer process configured to process the input string and to identify lexemes in the input string so as to accept or to reject grammatical structure of the input string; (c) generating a plurality of Left Recursive Earley (LRE) states and transitions between the LRE states by the recognizer process based on the lexemes, and entering the LRE states and the transitions into a state set table; (d) once the LRE states and the state set table are generated, parsing complete elements from a latest LRE state, wherein an order of elements within the state is preserved; (e) discarding an accepting element, when the extracted elements contain the accepting element, and when there are more lexemes left in the input string; (f) computing a parent-sibling relationship between a next element and an element currently located at a top of a stack; (g) pushing the next element onto the stack, when the stack is empty; (h) pushing the next element onto the stack, when the next element is a right sibling of the element currently located at a top of a stack; (i) repeating steps (d)-(h) until there are no lexemes left in the input string; and (j) generating the AST from the state set table that corresponds to the document.

---

Claim 9:
9. The method of claim 1 , wherein the accepting element is a last element of the input string accepted by the recognizer.