示例#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);