public ForStatementSharpnode(ForStatementSyntax stmt) : base(stmt) { this.Condition = RoslynToSharpnode.MapExpression(stmt.Condition); this.Statement = RoslynToSharpnode.MapStatement(stmt.Statement); // Add declarations if (stmt.Declaration != null) { this.Initializers.Add(new LocalDeclarationSharpnode(stmt.Declaration)); } // Add initializers if (stmt.Initializers != null) { foreach (var initializer in stmt.Initializers) { Initializers.Add(new ExpressionStatementSharpnode(initializer)); } } foreach (var incrementor in stmt.Incrementors) { this.Incrementors.Add(RoslynToSharpnode.MapExpression(incrementor)); } }
public IfStatementSharpnode(IfStatementSyntax stmt) : base(stmt) { this.Condition = RoslynToSharpnode.MapExpression(stmt.Condition); this.Then = RoslynToSharpnode.MapStatement(stmt.Statement); this.Else = stmt.Else != null?RoslynToSharpnode.MapStatement(stmt.Else.Statement) : null; }
public LabeledStatementSharpnode(LabeledStatementSyntax stmt) : base(stmt) { this.Self = stmt; this.Statement = RoslynToSharpnode.MapStatement(stmt.Statement); }