コード例 #1
0
ファイル: Program.cs プロジェクト: abock/dotlang
        static DigraphSyntax BuildAstGraph()
        {
            var types = typeof(SyntaxNode)
                        .Assembly
                        .GetTypes()
                        .Where(type => type.IsClass &&
                               typeof(SyntaxNode).IsAssignableFrom(type))
                        .OrderBy(type => Depth(type))
                        .ThenBy(type => type.BaseType?.Name)
                        .ThenBy(type => type.Name);

            return(new DigraphSyntax(
                       new StatementSyntax[]
            {
                ("rankdir", "LR"),
                ("bgcolor", "transparent"),
                new AttributeStatementSyntax(
                    AttributeKeyword.Node,
                    ("fontname", "sans-serif"),
                    ("color", "#102538"),
                    ("fontcolor", "#337ab7"),
                    ("shape", "record")),
                new AttributeStatementSyntax(
                    AttributeKeyword.Edge,
                    ("color", "#3B5266")),
            }.Concat(types
コード例 #2
0
 public virtual bool VisitAttributeStatementSyntax(
     AttributeStatementSyntax attributeStatement,
     VisitKind visitKind)
 => VisitStatementSyntax(attributeStatement, visitKind);