grammatical analysis

See for example Tcllib's packages

See also Scripted Compiler.