示例#1
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            $"{Id.AST(depth + 1)}" +
            $"{DeclarationBlock.AST(depth + 1)}" +
            $"{MainBlock.AST(depth + 1)}{Spaces(depth)}]\n");
 }
示例#2
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name} {(Reference ? "Ref" : "")}\n" +
            $"{Id.AST(depth + 1)}" +
            $"{Type.AST(depth + 1)}" +
            $"{Spaces(depth)}]\n");
 }
示例#3
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            $"{Id.AST(depth + 1)}" +
            (Type != null ? $"{Type.AST(depth + 1)}" : "") +
            $"{Spaces(depth)}]\n");
 }
示例#4
0
        public override string AST(int depth = 0)
        {
            var sb = new StringBuilder($"{Spaces(depth)}[{Name}\n" +
                                       (Type != null ? $"{Type.AST(depth + 1)}" : "") +
                                       $"{Id.AST(depth + 1)}");

            foreach (var s in Parameters)
            {
                sb.Append(s.AST(depth + 1));
            }

            sb.Append($"{Statement.AST(depth + 1)}{Spaces(depth)}]\n");

            return(sb.ToString());
        }
示例#5
0
        public override string AST(int depth = 0)
        {
            var sb = new StringBuilder($"{Spaces(depth)}[{Name}\n" +
                                       $"{Id.AST(depth + 1)}" +
                                       (Type != null ? $"{Type.AST(depth + 1)}" : ""));

            foreach (var a in Arguments)
            {
                sb.Append(a.AST(depth + 1));
            }

            sb.Append($"{Spaces(depth)}]\n");

            return(sb.ToString());
        }