10. A computer-implemented system for an abstract syntax tree (AST) builder, the system comprising: a processor; a memory couple to the processor; a lexical recognizer module running on the processor, the lexical recognizer module configured to process an input string that corresponds to a document and to identify lexemes in the input string so as to accept or to reject grammatical structure of the input string, and to generate a plurality of Left Recursive Earley (LRE) states based on the lexemes, and enter the LRE states and the transitions into a state set table, a converter couple to the lexical recognizer module, the converter configure to generate encoded structures using a conversion map; an AST processor coupled to the converter for receiving grammatical structures, wherein the AST processor is configured to: once the LRE states and the state set table are generated, parse complete elements from a latest LRE state, wherein an order of elements within the state is preserved; discard an accepting element, when the extracted elements contain the accepting element, and when there are more lexemes left in the input string; compute a parent-sibling relationship between a next element and an element currently located at a top of a stack; push the next element onto the stack, when the stack is empty; push 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, and generate the AST from the state set table that corresponds to the document.
10. A computer-implemented system for an abstract syntax tree (AST) builder, the system comprising: a processor; a memory couple to the processor; a lexical recognizer module running on the processor, the lexical recognizer module configured to process an input string that corresponds to a document and to identify lexemes in the input string so as to accept or to reject grammatical structure of the input string, and to generate a plurality of Left Recursive Earley (LRE) states based on the lexemes, and enter the LRE states and the transitions into a state set table, a converter couple to the lexical recognizer module, the converter configure to generate encoded structures using a conversion map; an AST processor coupled to the converter for receiving grammatical structures, wherein the AST processor is configured to: once the LRE states and the state set table are generated, parse complete elements from a latest LRE state, wherein an order of elements within the state is preserved; discard an accepting element, when the extracted elements contain the accepting element, and when there are more lexemes left in the input string; compute a parent-sibling relationship between a next element and an element currently located at a top of a stack; push the next element onto the stack, when the stack is empty; push 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, and generate the AST from the state set table that corresponds to the document. 14. The system of claim 10 , wherein the AST is constructed by the end of the recognition process based on a relationship between adjacent elements.