public override void ToSource(StringBuilder sb) { sb.Append("lock("); target.ToSource(sb); sb.Append(")"); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append(IdentNewLine(DocComment)); if (attributes != null) { attributes.ToSource(sb); } TraceModifiers(Modifiers, sb); sb.Append("~"); Names[0].ToSource(sb); sb.Append("()"); if ((Modifiers & Modifier.Extern) != 0) { sb.Append(';'); NewLine(sb); } else { NewLine(sb); statementBlock.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("for("); if (init != null) { init.ToSource(sb, ", "); } sb.Append("; "); if (test != null) { test.ToSource(sb); } sb.Append("; "); if (inc != null) { inc.ToSource(sb, ", "); } sb.Append(")"); NewLine(sb); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append("while ("); test.ToSource(sb); sb.Append(")"); NewLine(sb); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append("using("); resource.ToSource(sb); sb.Append(")"); NewLine(sb); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append("fixed("); localPointers.ToSource(sb); sb.Append(")"); NewLine(sb); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append(IdentNewLine(DocComment)); if (attributes != null) { attributes.ToSource(sb); } TraceModifiers(Modifiers, sb); if (isStaticConstructor) { sb.Append("static "); } Names[0].ToSource(sb); sb.Append("("); if (parameters != null) { parameters.ToSource(sb, ", "); } sb.Append(")"); // possible :this or :base if (hasBase || hasThis) { if (hasBase) { sb.Append(" : base("); } else { sb.Append(" : this("); } if (thisBaseArgs != null) { thisBaseArgs.ToSource(sb, ", "); } sb.Append(")"); } if ((Modifiers & Modifier.Extern) != 0) { sb.Append(';'); NewLine(sb); } else { NewLine(sb); statementBlock.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("try"); NewLine(sb); tryBlock.ToSource(sb); foreach (CatchNode cb in catchBlocks) { cb.ToSource(sb); } if (finallyBlock != null) { finallyBlock.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("checked "); if (checkedExpression != null) { sb.Append("("); checkedExpression.ToSource(sb); sb.Append(")"); sb.Append(";"); } else { checkedBlock.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("delegate "); if (parameters != null) { sb.Append("( "); parameters.ToSource(sb, ", "); sb.Append(") "); } indent++; NewLine(sb); statementBlock.ToSource(sb); indent--; }
public override void ToSource(StringBuilder sb) { sb.Append("foreach ("); iterator.ToSource(sb); sb.Append(" in "); collection.ToSource(sb); sb.Append(")"); NewLine(sb); statements.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append(IdentNewLine(DocComment)); if (attributes != null) { attributes.ToSource(sb); } TraceModifiers(Modifiers, sb); type.ToSource(sb); sb.Append(" "); names[0].ToSource(sb); if (IsGeneric) { Generic.TypeParametersToSource(sb); } sb.Append("("); if (parameters != null) { parameters.ToSource(sb, ", "); } sb.Append(")"); if (IsGeneric) { Generic.ConstraintsToSource(sb); } if ((Modifiers & (Modifier.Abstract | Modifier.Extern)) != 0) { sb.Append(';'); NewLine(sb); } else { NewLine(sb); statementBlock.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("catch"); if (classType != null) { sb.Append("("); classType.ToSource(sb); if (identifier != null) { sb.Append(' '); identifier.ToSource(sb); } sb.Append(")"); } NewLine(sb); catchBlock.ToSource(sb); }
public override void ToSource(StringBuilder sb) { sb.Append("if("); if (test != null) { test.ToSource(sb); } sb.Append(")"); NewLine(sb); statements.ToSource(sb); if (elseStatements != null) { sb.Append("else"); NewLine(sb); elseStatements.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append(IdentNewLine(DocComment)); if (attributes != null) { attributes.ToSource(sb); } TraceModifiers(Modifiers, sb); if (isExplicit) { sb.Append("explicit operator "); type.ToSource(sb); } else if (isImplicit) { sb.Append("implicit operator "); type.ToSource(sb); } else { type.ToSource(sb); sb.Append(" operator "); switch (op) { case TokenID.Plus: case TokenID.Minus: case TokenID.Not: case TokenID.Tilde: case TokenID.Star: case TokenID.Slash: case TokenID.Percent: case TokenID.BAnd: case TokenID.BOr: case TokenID.BXor: case TokenID.Greater: case TokenID.Less: sb.Append((char)op); break; case TokenID.PlusPlus: sb.Append("++"); break; case TokenID.MinusMinus: sb.Append("--"); break; case TokenID.True: sb.Append("true"); break; case TokenID.False: sb.Append("false"); break; case TokenID.ShiftLeft: sb.Append("<<"); break; case TokenID.ShiftRight: sb.Append(">>"); break; case TokenID.EqualEqual: sb.Append("=="); break; case TokenID.NotEqual: sb.Append("!="); break; case TokenID.GreaterEqual: sb.Append(">="); break; case TokenID.LessEqual: sb.Append("<="); break; default: sb.Append("<ILLEGAL OPERATOR: " + op + ">"); break; } } sb.Append("("); if (param1 != null) { param1.ToSource(sb); } if (param2 != null) { sb.Append(", "); param2.ToSource(sb); } sb.Append(")"); if ((Modifiers & Modifier.Extern) != 0) { sb.Append(';'); NewLine(sb); } else { NewLine(sb); statements.ToSource(sb); } }
public override void ToSource(StringBuilder sb) { sb.Append("finally"); NewLine(sb); finallyBlock.ToSource(sb); }