protected virtual void VisitSwitchSection(BoundSwitchSection node)
        {
            foreach (var label in node.Labels)
            {
                VisitSwitchLabel(label);
            }

            foreach (var statement in node.Statements)
            {
                VisitStatement(statement);
            }
        }
Example #2
0
 internal void Parse(BoundSwitchSection boundSwitchSection)
 {
     base.Parse(boundSwitchSection);
     foreach (var boundSwitchLabel in boundSwitchSection.BoundSwitchLabels)
     {
         Debug.Assert(boundSwitchLabel.ExpressionOpt == null, "check it");
         var sourceLabelSymbol = (boundSwitchLabel.Label as SourceLabelSymbol);
         if (sourceLabelSymbol != null)
         {
             var switchLabel = new SwitchLabel();
             switchLabel.Parse(sourceLabelSymbol);
             this.Labels.Add(switchLabel);
         }
     }
 }
Example #3
0
        internal void Parse(BoundSwitchSection boundSwitchSection)
        {
            base.Parse(boundSwitchSection);
            foreach (var boundSwitchLabel in boundSwitchSection.SwitchLabels)
            {
                var labelSymbol = (boundSwitchLabel.Label as LabelSymbol);
                if (labelSymbol != null)
                {
                    var switchLabel = new SwitchLabel();
                    switchLabel.Parse(labelSymbol);
                    if (boundSwitchLabel.ConstantValueOpt != null)
                    {
                        switchLabel.Value = boundSwitchLabel.ConstantValueOpt;
                    }

                    this.Labels.Add(switchLabel);
                    continue;
                }
            }
        }
Example #4
0
        public override BoundNode VisitSwitchSection(BoundSwitchSection node)
        {
            EnsureOnlyEvalStack();

            // implicit control flow
            return base.VisitSwitchSection(node);
        }
Example #5
0
        private void EmitSwitchSection(BoundSwitchSection switchSection)
        {
            foreach (var boundSwitchLabel in switchSection.SwitchLabels)
            {
                _builder.MarkLabel(boundSwitchLabel.Label);
            }

            foreach (var statement in switchSection.Statements)
            {
                EmitStatement(statement);
            }
        }