示例#1
0
 /// <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();
 }
示例#2
0
 /// <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();
 }
示例#3
0
 /// <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);
 }
示例#4
0
 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;
 }
示例#5
0
 /// <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);
 }