static void Main(string[] args) { while (true) { Console.WriteLine("Please enter QL syntax commit by Ctrl+Z. Quit by Ctrl+C"); Console.WriteLine(); Stream inputStream = Console.OpenStandardInput(); QLBuilder ast = new QLBuilder(inputStream); ast.RegisterGenericDataHandlers(); ast.RunInit(); ast.RunASTBuilders(); ast.RunTypeCheckers(); ast.RunEvaluators(); foreach (Exception e in ast.UnhandledExceptions) { Console.WriteLine(e.ToString()); } Console.Write("Hit <return> to restart"); Console.ReadLine(); Console.Clear(); } }
public void Initialize(string input) { Builder = new QLBuilder(input); Builder.RegisterGenericDataHandlers(); Assert.IsTrue(Builder.RunInit()); Assert.IsTrue(Builder.RunASTBuilders()); Assert.IsTrue(Builder.RunTypeCheckers()); }
public void CollectNothing() { Initialize(@"form ExampleBlock { if (3==-11){} else { if (3==12) {} else {}; }; } "); Assert.IsTrue(Builder.RunTypeCheckers()); Assert.AreEqual(0, Builder.DataContext.ASTHandlerExceptions.Count); }