public void Validate(string path) { using (var fileStream = new StreamReader(path)) { var input = new AntlrInputStream(fileStream); var lexer = new PoeFilterLexer(input); var tokens = new CommonTokenStream(lexer); var parser = new Model.PoeFilterParser(tokens); parser.RemoveErrorListeners(); parser.AddErrorListener(new ErrorListener()); var tree = parser.main(); var visitor = new FakePoeFilterVisitor(); var result = visitor.Visit(tree); Assert.IsTrue(result); } }