public static < T > T generateParser ( File src ) throws Exception { ANTLRInputStream input = new ANTLRInputStream ( new FileInputStream ( src ) ) ; Lexer lexer = AunitRuntime . getLexerFactory ( ) . generate ( input ) ; CommonTokenStream tokens = new CommonTokenStream ( lexer ) ; //noinspection unchecked return ( T ) AunitRuntime . getParserFactory ( ) . generate ( tokens ) ; }
Generate an instance of the configured parser using a file as a source for input .