コード例 #1
0
        public BoundGoToStatement(GoToStatementSyntax syntax, string label)
        {
            Debug.Assert(!syntax.IsDefault(), "'syntax' must not be null.");
            Debug.Assert(!label.IsDefault(), "'label' must not be null.");

            this.Syntax = syntax;
            this.Label  = label;
        }
コード例 #2
0
 public override void VisitGoToStatement(GoToStatementSyntax node)
 {
     State.IncreaseComplexityByNestingPlusOne(node.GoToKeyword);
     base.VisitGoToStatement(node);
 }
コード例 #3
0
 public override void VisitGoToStatement(GoToStatementSyntax node)
 {
     LogicalLineCount++;
     base.VisitGoToStatement(node);
 }
コード例 #4
0
        private GoTo TraverseGoTo(List<LabelStatement> labels, GoToStatementSyntax gtss)
        {
            GoTo gotoStm = new GoTo();

            LabelSyntax lss = gtss.Label;

            string lblName = lss.LabelToken.ValueText;

            bool found = false;

            foreach(LabelStatement lblStm in labels){
                if (lblStm.Name == lblName)
                {
                    gotoStm.GoToLabel = lblStm;
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                gotoStm.GoToLabel = new LabelStatement() { Name = lblName };
            }

            return gotoStm;
        }