Beispiel #1
0
        public override void VisitForStatement(ForStatementSyntax node)
        {
            if (debug)
            {
                Console.WriteLine(node.ToFullString());
            }
            var nl = OurLine.NewLine(LineKind.Decl, "ForStatement");

            if (node.Condition != null)
            {
                OurLine.AddEssentialInfo(ref nl, "condition:" + node.Condition.ToString());
            }
            if (node.Declaration != null)
            {
                OurLine.AddEssentialInfo(ref nl, "declaration:" + node.Declaration.ToString());
            }
            if (node.Statement != null)
            {
                OurLine.AddEssentialInfo(ref nl, "statement:" + node.Statement.ToString());
            }
            if (node.Incrementors != null)
            {
                OurLine.AddEssentialInfo(ref nl, "incrementors:" + node.Incrementors.ToString());
            }
            if (node.Initializers != null)
            {
                OurLine.AddEssentialInfo(ref nl, "initializers:" + node.Initializers.ToString());
            }
            nl.Source     = node.ToFullString();
            nl.ParentKind = node.Parent.RawKind;
            nl.RawKind    = node.RawKind;
            LogCommand(nl);
            StartBlock("ForStatement");
            base.VisitForStatement(node);
            EndBlock("ForStatement");
        }