1 | public void ToSource(StringBuilder sb) | | 1 | protected void WriteLocalSource(StringBuilder sb, String kind) |
2 | { | | 2 | { |
3 | if (attributes != null) | | 3 | if (attributes != null) |
4 | { | | 4 | { |
5 | attributes.ToSource(sb); | | 5 | attributes.ToSource(sb); |
6 | this.NewLine(sb); | | 6 | this.NewLine(sb); |
7 | } | | 7 | } |
8 | this.TraceModifiers(this.modifiers, sb); | | 8 | TraceModifiers(Modifiers, sb); |
9 | | | 9 | |
10 | if (isStaticConstructor) | | 10 | sb.append(kind + " "); |
11 | { | | 11 | Name.ToSource(sb); |
12 | sb.append("static "); | | 12 | sb.append(" "); |
13 | } | | 13 | |
14 | | | 14 | if (BaseClasses != null && BaseClasses.size() > 1) |
15 | this.names.get(0).ToSource(sb); | | 15 | { |
16 | sb.append("("); | | 16 | sb.append(": "); |
17 | | | 17 | String comma = ""; |
18 | String comma = ""; | | 18 | for(TypeNode bcls:BaseClasses) |
19 | if (params != null) | | 19 | { |
20 | { | | 20 | sb.append(comma); |
21 | for (int i = 0; i < params.size(); i++) | | 21 | comma = ", "; |
22 | { | | 22 | bcls.ToSource(sb); |
23 | sb.append(comma); | | 23 | } |
24 | comma = ", "; | | 24 | } |
25 | params.get(i).ToSource(sb); | | 25 | |
26 | } | | 26 | this.NewLine(sb); |
27 | } | | 27 | sb.append("{"); |
28 | sb.append(")"); | | 28 | indent++; |
29 | | | 29 | this.NewLine(sb); |
30 | // possible :this or :base | | 30 | |
31 | if (hasBase) | | 31 | if(Constants != null) |
32 | { | | 32 | { |
33 | sb.append(" : base("); | | 33 | Constants.ToSource(sb); |
34 | } | | 34 | } |
35 | else if (hasThis) | | 35 | if(Fields != null) |
36 | { | | 36 | { |
37 | sb.append(" : this("); | | 37 | Fields.ToSource(sb); |
38 | } | | 38 | } |
39 | if (hasBase || hasThis) | | 39 | if(Properties != null) |
40 | { | | 40 | { |
41 | if (thisBaseArgs != null) | | 41 | Properties.ToSource(sb); |
42 | { | | 42 | } |
43 | comma = ""; | | 43 | if (Constructors != null) |
44 | for (int i = 0; i < thisBaseArgs.size(); i++) | | 44 | { |
45 | { | | 45 | Constructors.ToSource(sb); |
46 | sb.append(comma); | | 46 | } |
47 | comma = ", "; | | 47 | if (Methods != null) |
48 | thisBaseArgs.get(i).ToSource(sb); | | 48 | { |
49 | } | | 49 | Methods.ToSource(sb); |
50 | } | | 50 | } |
51 | sb.append(")"); | | 51 | if (Indexers != null) |
52 | } | | 52 | { |
53 | | | 53 | Indexers.ToSource(sb); |
54 | // start block | | 54 | } |
55 | this.NewLine(sb); | | 55 | if (Events != null) |
56 | | | 56 | { |
57 | statementBlock.ToSource(sb); | | 57 | Events.ToSource(sb); |
58 | | | 58 | } |
59 | } | | 59 | if (Destructors != null) |
| | | 60 | { |
| | | 61 | Destructors.ToSource(sb); |
| | | 62 | } |
| | | 63 | |
| | | 64 | indent--; |
| | | 65 | this.NewLine(sb); |
| | | 66 | sb.append("}"); |
| | | 67 | this.NewLine(sb); |
| | | 68 | |
| | | 69 | } |