Beispiel #1
0
        public int AddVar(ItemForVar item)
        {
            int newIndex = this.GetNewCellIndex(item.GetType());
            item.SetIndex( newIndex );
            this._varItemList.Add(item);
            this.AddItemToFinalArray(item);

            return newIndex;
        }
        public int AddVar(ItemForVar item)
        {
            int newIndex = this.GetNewCellIndex(item.GetType());

            item.SetIndex(newIndex);
            this._varItemList.Add(item);
            this.AddItemToFinalArray(item);

            return(newIndex);
        }
Beispiel #3
0
        private string WorkWithAssignments(string text)
        {
            Func func;

            int lastFuncIndex = 0;

            while ((func = Programm.FindFunc(lastFuncIndex, text)) != null)
            {
                int        lastVarInitIndex = 0;
                Assignment assignment;

                while ((func = Programm.FindFunc(lastFuncIndex, text)) != null && (assignment = Programm.FindAssignment(lastVarInitIndex, func.GetBody())) != null)
                {
                    ItemForVar varibale = this._table.GetItem(assignment.GetVaribaleName(), func.GetName());
                    text = text.Remove(func.GetIndexFuncIntoText() + func.GetIndexBody() + assignment.GetIndexIntoText(), assignment.GetText().Length);
                    string newAssignment = this.GetFuncCallToWrite(varibale.GetIndex(), varibale.GetType(), assignment.GetRightText());
                    text = text.Insert(func.GetIndexFuncIntoText() + func.GetIndexBody() + assignment.GetIndexIntoText(), newAssignment);

                    lastVarInitIndex = assignment.GetIndexIntoText() + assignment.GetText().Length;
                }

                lastFuncIndex = func.GetIndexFuncIntoText() + func.GetFuncText().Length;
            }
            return(text);
        }