public override sealed object VisitSwitchSection(SwitchSection switchSection, object data)
 {
     this.BeginVisit(switchSection);
     object result = this.TrackedVisitSwitchSection(switchSection, data);
     this.EndVisit(switchSection);
     return result;
 }
 public virtual object TrackedVisitSwitchSection(SwitchSection switchSection, object data)
 {
     return base.VisitSwitchSection(switchSection, data);
 }
예제 #3
0
 public override object VisitSwitchSection(SwitchSection switchSection, object data)
 {
     return VisitBlockStatement(switchSection, data);
 }
예제 #4
0
 public virtual object VisitSwitchSection(SwitchSection switchSection, object data)
 {
     Debug.Assert((switchSection != null));
     Debug.Assert((switchSection.SwitchLabels != null));
     foreach (CaseLabel o in switchSection.SwitchLabels) {
         Debug.Assert(o != null);
         o.AcceptVisitor(this, data);
     }
     return switchSection.AcceptChildren(this, data);
 }
 public virtual object VisitSwitchSection(SwitchSection switchSection, object data)
 {
     throw new global::System.NotImplementedException("SwitchSection");
 }
예제 #6
0
        void SelectStatement(out Statement statement)
        {
            Expression expr = null;
            Expect(197);
            if (la.kind == 74) {
            Get();
            }
            Expr(out expr);
            EndOfStmt();
            List<SwitchSection> selectSections = new List<SwitchSection>();
            Statement block = null;

            while (la.kind == 74) {
            List<CaseLabel> caseClauses = null; Location caseLocation = la.Location;
            Get();
            CaseClauses(out caseClauses);
            if (IsNotStatementSeparator()) {
                Expect(21);
            }
            EndOfStmt();
            SwitchSection selectSection = new SwitchSection(caseClauses);
                selectSection.StartLocation = caseLocation;

            Block(out block);
            selectSection.Children = block.Children;
                selectSection.EndLocation = t.EndLocation;
                selectSections.Add(selectSection);

            }
            statement = new SwitchStatement(expr, selectSections);

            Expect(113);
            Expect(197);
        }
 public virtual object VisitSwitchSection(SwitchSection switchSection, object data)
 {
     Debug.Assert((switchSection != null));
     Debug.Assert((switchSection.SwitchLabels != null));
     for (int i = 0; i < switchSection.SwitchLabels.Count; i++) {
         CaseLabel o = switchSection.SwitchLabels[i];
         Debug.Assert(o != null);
         nodeStack.Push(o);
         o.AcceptVisitor(this, data);
         o = (CaseLabel)nodeStack.Pop();
         if (o == null)
             switchSection.SwitchLabels.RemoveAt(i--);
         else
             switchSection.SwitchLabels[i] = o;
     }
     for (int i = 0; i < switchSection.Children.Count; i++) {
         INode o = switchSection.Children[i];
         Debug.Assert(o != null);
         nodeStack.Push(o);
         o.AcceptVisitor(this, data);
         o = nodeStack.Pop();
         if (o == null)
             switchSection.Children.RemoveAt(i--);
         else
             switchSection.Children[i] = o;
     }
     return null;
 }