コード例 #1
0
ファイル: CodeWalker.cs プロジェクト: eimslab/Shove.Net.Fx2
        private void Walk(int index, IActionExaminer examiner, ArrayList visitedLabels)
        {
            while (index < actionRec.Count)
            {
                BaseAction a = (BaseAction)actionRec[index];

                if (a is ActionLabel)
                {
                    ActionLabel l = a as ActionLabel;
                    if (visitedLabels.Contains(l.LabelId))
                    {
                        //examiner.End();
                        return;
                    }
                    else
                    {
                        visitedLabels.Add(l.LabelId);
                    }
                }

                examiner.Examine(index, a);

                if (a is ActionJump)
                {
                    ActionJump j = a as ActionJump;
                    index = (int)labelIndexTable[j.LabelId] - 1;
                }

                if (a is ActionIf)
                {
                    ActionIf ai = a as ActionIf;
                    if (!visitedLabels.Contains(ai.LabelId))
                    {
                        Walk((int)labelIndexTable[ai.LabelId], examiner.Clone(), (ArrayList)visitedLabels.Clone());
                    }
                }

                if (a is ActionReturn)
                {
                    //examiner.End();
                    return;
                }

                index++;
            }

            //examiner.End();
        }
コード例 #2
0
ファイル: CodeWalker.cs プロジェクト: heon21st/flashdevelop
		private void Walk(int index,IActionExaminer examiner,ArrayList visitedLabels) {
						
			while (index<actionRec.Count) {
				
				BaseAction a = (BaseAction)actionRec[index];
				
				if (a is ActionLabel) {
					ActionLabel l = a as ActionLabel;						
					if (visitedLabels.Contains(l.LabelId)) {
						//examiner.End();
						return;	
						
					} else {
						visitedLabels.Add(l.LabelId);
					}
				}
				
				examiner.Examine(index,a);
				
				if (a is ActionJump) {
						
					ActionJump j = a as ActionJump;
					index = (int)labelIndexTable[j.LabelId]-1;
				}				
				
				if (a is ActionIf) {
					ActionIf ai = a as ActionIf;
					if (!visitedLabels.Contains(ai.LabelId)) {
						Walk( (int)labelIndexTable[ai.LabelId], examiner.Clone(), (ArrayList)visitedLabels.Clone() );	
					}
				}
				
				if (a is ActionReturn) {
					//examiner.End();
					return;
				}
	
				index++;				
			}
			
			//examiner.End();
		}
コード例 #3
0
 /// <summary>
 /// Start traversing.
 /// </summary>
 /// <param name="examiner">IActionExaminer object</param>
 public virtual void Traverse(IActionExaminer examiner)
 {
     visitedLabels = new ArrayList();
     traverse(0,examiner);
 }
コード例 #4
0
ファイル: CodeWalker.cs プロジェクト: bladecoding/SwfExport
 /// <summary>
 /// Start traversing code flow at index 0.
 /// </summary>
 /// <param name="examiner">IActionExaminer object</param>
 public void Walk(IActionExaminer examiner)
 {
     ArrayList visitedLabels = new ArrayList();
     Walk(0,examiner,visitedLabels);
 }
コード例 #5
0
ファイル: CodeWalker.cs プロジェクト: bladecoding/SwfExport
 /// <summary>
 /// Start traversing at given index.
 /// </summary>
 /// <param name="examiner">IActionExaminer object</param>
 /// <param name="index">start index for code traversation.</param>
 public void Walk(IActionExaminer examiner,int index)
 {
     ArrayList visitedLabels = new ArrayList();
     Walk(index,examiner,visitedLabels);
 }
コード例 #6
0
 /// <summary>
 /// Start traversing.
 /// </summary>
 /// <param name="examiner">IActionExaminer object</param>
 public virtual void Traverse(IActionExaminer examiner)
 {
     visitedLabels = new ArrayList();
     traverse(0, examiner);
 }
コード例 #7
0
ファイル: CodeWalker.cs プロジェクト: eimslab/Shove.Net.Fx2
        /// <summary>
        /// Start traversing at given index.
        /// </summary>
        /// <param name="examiner">IActionExaminer object</param>
        /// <param name="index">start index for code traversation.</param>
        public void Walk(IActionExaminer examiner, int index)
        {
            ArrayList visitedLabels = new ArrayList();

            Walk(index, examiner, visitedLabels);
        }
コード例 #8
0
ファイル: CodeWalker.cs プロジェクト: eimslab/Shove.Net.Fx2
        /// <summary>
        /// Start traversing code flow at index 0.
        /// </summary>
        /// <param name="examiner">IActionExaminer object</param>
        public void Walk(IActionExaminer examiner)
        {
            ArrayList visitedLabels = new ArrayList();

            Walk(0, examiner, visitedLabels);
        }