Esempio n. 1
0
        //------------------------------------------------------------
        public override CTerm_Base Clone()
        {
            CTerm_Variable other = new CTerm_Variable(_Name);

            other._Value = (_Value == null) ? null : _Value.Clone();
            return(other);
        }
Esempio n. 2
0
        //------------------------------------------------------------
        protected override CTerm_Base Compile(ref string Term, Stack <CTerm_Base> Stack, CEnvironment Env)
        {
            _Term = null;
            if ((Stack.Count < 1) || (Stack.Peek().Type != TTermType.Variable))
            {
                throw new CTermException(_Name + " needs a left-side operand!");
            }

            _Variable = (CTerm_Variable)Stack.Pop();

            int        count   = Stack.Count;
            CTerm_Base Pending = GetNextTerm(ref Term, Stack, Env, TPriority.end);

            if (Stack.Count <= count)
            {
                throw new CTermException(_Name + " needs a right-side operand!");
            }

            _Term = Stack.Pop();

            return(Pending);
        }
Esempio n. 3
0
 //------------------------------------------------------------
 public CTerm_Assignment(string Name)
     : base(Name, TPriority.function, TTermType.Assignment)
 {
     _Term     = null;
     _Variable = null;
 }