/// <summary> /// The constructor for a message router. /// </summary> /// <param name="engine">The engine.</param> public MessageRouter(Rete.Rete engine) { InitBlock(); this.engine = engine; interpreter = new CLIPSInterpreter(engine); commandThread = new CommandThread(this); commandThread.Start(); }
/// <summary> /// The constructor for a message router. /// </summary> /// <param name="engine">The engine.</param> public MessageRouter(Rete.Rete engine) { this.engine = engine; this.engine.Message += engine_Message; interpreter = new CLIPSInterpreter(engine); }
public virtual IReturnVector eval(Rete engine, String command) { IReturnVector result = null; try { CLIPSParser parser = new CLIPSParser(engine, new MemoryStream(ASCIIEncoding.ASCII.GetBytes(command))); CLIPSInterpreter interpreter = new CLIPSInterpreter(engine); Object expr = null; while ((expr = parser.basicExpr()) != null) { result = interpreter.executeCommand(expr); } } catch (ParseException e) { // we should report the error Trace.WriteLine(e.Message); } return result; }