コード例 #1
0
ファイル: ControlFlowSimplifier.cs プロジェクト: Caspeco/JSIL
        public void VisitNode(JSSwitchCase sc)
        {
            SwitchCaseStack.Push(sc);

            if (TraceLevel >= 2) {
                if (sc.Values != null)
                    Console.WriteLine("// Entering case {0}", sc.Values.FirstOrDefault());
                else
                    Console.WriteLine("// Entering case default");
            }

            VisitChildren(sc);

            if (TraceLevel >= 2)
                Console.WriteLine("// Exiting case");

            SwitchCaseStack.Pop();
        }
コード例 #2
0
ファイル: LabelGroupBuilder.cs プロジェクト: KevinKelley/JSIL
 // Crossing these kinds of control flow boundaries would change behavior.
 public void VisitNode(JSSwitchCase sc)
 {
     VisitChildren(sc);
 }
コード例 #3
0
ファイル: ControlFlowSimplifier.cs プロジェクト: Caspeco/JSIL
        public void VisitNode(JSBlockStatement bs)
        {
            var thisSwitchCase = ParentSwitchCase;
            var parentLabelGroup = ParentNode as JSLabelGroupStatement;
            var isControlFlow = bs.IsControlFlow ||
                (thisSwitchCase != LastSwitchCase) ||
                (parentLabelGroup != null);

            if (TraceLevel >= 2)
                Console.WriteLine("// Entering block {0}", bs.Label ?? bs.GetType().Name);

            if (isControlFlow) {
                if (TraceLevel >= 2)
                    Console.WriteLine("// Count reset");

                AbsoluteJumpsSeenStack.Add(0);
            }

            BlockStack.Push(bs);

            VisitChildren(bs);

            BlockStack.Pop();

            if (TraceLevel >= 2)
                Console.WriteLine("// Exiting block");

            if (isControlFlow)
                AbsoluteJumpsSeenStack.RemoveAt(AbsoluteJumpsSeenStack.Count - 1);

            LastSwitchCase = thisSwitchCase;
        }