working example using stateful parser to match braces, including type of braces ( '(' '[' or '{' ), generates useful error messages