public void Initialize(string input) { Builder = new QLBuilder(input); Builder.RegisterGenericDataHandlers(); Assert.IsTrue(Builder.RunInit()); Assert.IsTrue(Builder.RunASTBuilders()); }
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 MinusSign() { string input = @"form ExampleBlock { statement Smthing1 (number, (1+(2 -3))) ""this ""; statement Smthing2 (number, (1+(2-3))) ""should""; statement Smthing3 (number, (1+(2 --3))) ""be""; statement Smthing4 (number, (1+(2-- 3))) ""solved""; } "; QLBuilder Handler = new QLBuilder(input); Handler.RegisterGenericDataHandlers(); Assert.AreEqual(true, Handler.RunInit()); Assert.AreEqual(true, Handler.RunASTBuilders()); }