Пример #1
0
 public ComponentSet(JepInstance j)
 {
     this.numFac    = j.NumFac;
     this.varFac    = j.VarFac;
     this.nodeFac   = j.NodeFac;
     this.varTab    = j.VarTab;
     this.funTab    = j.FunTab;
     this.opTab     = j.OpTab;
     this.parser    = j.Parser;
     this.evaluator = j.Evaluator;
     this.pv        = j.PrintVisitor;
 }
Пример #2
0
 public void SetComponents(IJepComponent[] components)
 {
     foreach (IJepComponent component in components)
     {
         if (component is INumberFactory)
         {
             this._numFac = (INumberFactory)component;
         }
         else if (component is VariableFactory)
         {
             this._varFac = (VariableFactory)component;
         }
         else if (component is NodeFactory)
         {
             this._nodeFac = (NodeFactory)component;
         }
         else if (component is VariableTable)
         {
             this._varTab = (VariableTable)component;
         }
         else if (component is FunctionTable)
         {
             this._funTab = (FunctionTable)component;
         }
         else if (component is OperatorTable)
         {
             this._opTab = (OperatorTable)component;
         }
         else if (component is IParser)
         {
             this._parser = (IParser)component;
         }
         else if (component is IEvaluator)
         {
             this._evaluator = (IEvaluator)component;
         }
         else if (component is Colosoft.Text.Jep.PrintVisitor)
         {
             this._pv = (Colosoft.Text.Jep.PrintVisitor)component;
         }
     }
     this.ReinitializeComponents();
 }