Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. In computer
science, a graph-structured stack is a directed acyclic graph where each
directed path represents a stack. The graph-structured stack is an
essential part of Tomita's algorithm, where it replaces the usual stack
of a pushdown automaton. This allows the algorithm to encode the
nondeterministic choices in parsing an ambiguous grammar, sometimes with
greater efficiency. In the following diagram, there are four stacks:
{7,3,1,0}, {7,4,1,0}, {7,5,2,0}, and {8,6,2,0}.