public static TokenSource getTokenSourceForFile ( File file ) throws FileNotFoundException { // Create a token source to load the model rules from. Reader ins = new FileReader ( file ) ; SimpleCharStream inputStream = new SimpleCharStream ( ins , 1 , 1 ) ; PrologParserTokenManager tokenManager = new PrologParserTokenManager ( inputStream ) ; return new TokenSource ( tokenManager ) ; }
Creates a token source on a file .