コード例 #1
0
        //------------------------------------------------------------
        public override CTerm_Base Clone()
        {
            CTerm_Variable other = new CTerm_Variable(_Name);

            other._Value = (_Value == null) ? null : _Value.Clone();
            return(other);
        }
コード例 #2
0
ファイル: CTerm_Assignment.cs プロジェクト: oelsnerc/Csharp
        //------------------------------------------------------------
        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);
        }
コード例 #3
0
ファイル: CTerm_Assignment.cs プロジェクト: oelsnerc/Csharp
 //------------------------------------------------------------
 public CTerm_Assignment(string Name)
     : base(Name, TPriority.function, TTermType.Assignment)
 {
     _Term     = null;
     _Variable = null;
 }