newParser function
Implementation
CandidParser newParser(String contents) {
final input = InputStream.fromString(contents);
final lexer = CandidLexer(input);
final tokens = CommonTokenStream(lexer);
final parser = CandidParser(tokens);
parser.addErrorListener(DiagnosticErrorListener());
parser.buildParseTree = true;
return parser;
}