List of usage examples for org.antlr.v4.runtime CharStreams fromPath
public static CharStream fromPath(Path path, Charset charset) throws IOException
From source file:org.kie.dmn.feel.parser.feel11.FEELTestRig.java
License:Apache License
@Override public void process() throws Exception { Charset charset = (encoding == null ? Charset.defaultCharset() : Charset.forName(encoding)); if (inputFiles.size() == 0) { CharStream charStream = CharStreams.fromStream(System.in, charset); process(lexer, parserClass, parser, charStream); return;/*from w w w. j ava 2 s . c om*/ } for (String inputFile : inputFiles) { CharStream charStream = CharStreams.fromPath(Paths.get(inputFile), charset); if (inputFiles.size() > 1) { System.err.println(inputFile); } process(lexer, parserClass, parser, charStream); } }