The present invention is a method (100) of determining the syntactic correctness
of an expression for use in a computing environment. After creating (30)
a string of characters from said expression, it looks for substrings (character
sequences), which are legitimate and replaces (54) them with a shorter but
semantically equivalent substring. It also looks for character sequences which
are illegitimate, and replaces (54) them with a substring (i.e. "?") to
indicate that it has met with an illegal sequence. It does these operations repeatedly,
and in predetermined sequences, till no further changes in the string can be made;
that is, the string achieves a constant length. An expression is determined to
be syntactically correct only if said string reduces to a single predetermined character.