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);
    }
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 ) ; return ( T ) AunitRuntime . getParserFactory ( ) . generate ( tokens ) ; }
Generate an instance of the configured parser using a file as a
source for input.

@param src the file to use as input to the new parser instance.
@param <T> the type of the parser
@return an instance of the configured parser
@throws Exception if there is an error generating the parser