Code example for PushbackReader

0
import dk.brics.jsparser.parser.Parser; 
 
public class TestUtil { 
    public static Start parseFile(File file) {
        try { 
            Start root = new Parser(new SemicolonInsertingLexer(new PushbackReader(new FileReader(file), 256))).parse();
            PrintStream stream = new PrintStream(new File("output/" + file.getName() + "-ast.txt"));
            try { 
                root.apply(new ASTPrinter(stream));
            } finally { 
                stream.close();
            } 
            return root;
        } catch (Exception ex) {
            throw new RuntimeException("\r\n"+ex.getMessage(), ex);
        } 
    } 
     
    public static void main(String[] args) {
      parseFile(new File(args[0]));
    }