public static void loadFrom(InputStream in, Proto target) throws Exception { // Create an input character stream from standard in ANTLRInputStream input = new ANTLRInputStream(in); // Create an ExprLexer that feeds from that stream ProtoLexer lexer = new ProtoLexer(input); // Create a stream of tokens fed by the lexer CommonTokenStream tokens = new CommonTokenStream(lexer); // Create a parser that feeds off the token stream ProtoParser parser = new ProtoParser(tokens); // Begin parsing at rule parse parser.parse(target); }