add option for output diagnostics of parse result to stderr if it has.
add option for output diagnostics of parse result to stderr if it has.