A system, method and computer program for validating a syntactical
statement employing a stored syntax tree which represents all possible
syntax options. The tree consists of a network of junction nodes and data
nodes between a root node and an end node, whereby all paths through the
tree lead to the end node. Firstly, a syntactical statement is passed to
the root node, where it is parsed into elementary tokens. Next, a table
is created to store the tokens, and entries representing the end node of
the syntax. The location of a current node in the syntax tree is also
maintained, whereby the current node is initially the root node. Then,
the potential nodes that can be selected from the current node and their
distances from the current node are returned. The potential nodes are
then compared to the stored tokens, and a potential node is selected.
Finally, the location of the current node is updated and the process is
repeated until the syntactical statement has been validated.