Ejemplo n.º 1
0
        private bool TryGetSwitchData(IfElseIfStatement node, out CreateCompilerOptimizedSwitchByStringStatementsStep.SwitchData data)
        {
            data = new CreateCompilerOptimizedSwitchByStringStatementsStep.SwitchData();
            V_0  = node.get_ConditionBlocks().GetEnumerator();
            try
            {
                while (V_0.MoveNext())
                {
                    V_1 = V_0.get_Current();
                    if (this.TryMatchCondition(V_1.get_Key(), V_1.get_Value(), data))
                    {
                        continue;
                    }
                    V_2 = false;
                    goto Label1;
                }
                goto Label0;
            }
            finally
            {
                ((IDisposable)V_0).Dispose();
            }
Label1:
            return(V_2);

Label0:
            if (node.get_Else() != null)
            {
                data.set_DefaultCase(node.get_Else());
            }
            return(true);
        }
Ejemplo n.º 2
0
 public virtual void VisitIfElseIfStatement(IfElseIfStatement node)
 {
     V_0 = 0;
     while (V_0 < node.get_ConditionBlocks().get_Count())
     {
         V_1 = node.get_ConditionBlocks().get_Item(V_0);
         this.Visit(V_1.get_Key());
         this.Visit(V_1.get_Value());
         V_0 = V_0 + 1;
     }
     this.Visit(node.get_Else());
     return;
 }
 public virtual ICodeNode VisitIfElseIfStatement(IfElseIfStatement node)
 {
     V_0 = 0;
     while (V_0 < node.get_ConditionBlocks().get_Count())
     {
         V_3 = node.get_ConditionBlocks().get_Item(V_0);
         V_1 = (Expression)this.Visit(V_3.get_Key());
         V_3 = node.get_ConditionBlocks().get_Item(V_0);
         V_2 = (BlockStatement)this.Visit(V_3.get_Value());
         V_2.set_Parent(node);
         node.get_ConditionBlocks().set_Item(V_0, new KeyValuePair <Expression, BlockStatement>(V_1, V_2));
         V_0 = V_0 + 1;
     }
     node.set_Else((BlockStatement)this.Visit(node.get_Else()));
     return(node);
 }