Пример #1
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");
 }
Пример #2
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            (Type != null ? $"{Type.AST(depth + 1)}" : "") +
            $"{Spaces(depth + 1)}[{Token.Content}]\n" +
            $"{Spaces(depth)}]\n");
 }
Пример #3
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            (Type != null ? $"{Type.AST(depth + 1)}" : "") +
            $"{Spaces(depth + 1)}[\"{Value}\"]\n" +
            $"{Spaces(depth)}]\n");
 }
Пример #4
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            $"{Type.AST(depth + 1)}" +
            $"{Spaces(depth + 1)}[{Op}]\n" +
            $"{Left.AST(depth + 1)}{Right.AST(depth + 1)}{Spaces(depth)}]\n");
 }
Пример #5
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            $"{Type.AST(depth + 1)}" +
            $"{LValue.AST(depth + 1)}" +
            $"{Spaces(depth)}]\n");
 }
Пример #6
0
 public override string AST(int depth = 0)
 {
     return($"{Spaces(depth)}[{Name}\n" +
            (Type != null ? $"{Type.AST(depth + 1)}" : "") +
            //$"{Id.AST(depth + 1)}{Expression.AST(depth + 1)}{Spaces(depth)}]\n";
            $"{LValue.AST(depth + 1)}{Expression.AST(depth + 1)}{Spaces(depth)}]\n");
 }
Пример #7
0
        public override string AST(int depth = 0)
        {
            var sb = new StringBuilder($"{Spaces(depth)}[{Name}\n");

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

            sb.Append(Type != null ? $"{Type.AST(depth + 1)}" : "");
            sb.Append($"{Spaces(depth)}]\n");

            return(sb.ToString());
        }
Пример #8
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());
        }