/// <summary> /// Initializes a new instance of the <see cref="CSharpAsLongAsInstruction"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly instruction from which the C# instruction is created.</param> protected CSharpAsLongAsInstruction(ICSharpContext context, ICSharpFeature parentFeature, IAsLongAsInstruction source) : base(context, parentFeature, source) { ContinueCondition = CSharpExpression.Create(context, (IExpression)source.ContinueCondition); foreach (IContinuation Continuation in source.ContinuationList) { ICSharpContinuation NewContinuation = CSharpContinuation.Create(context, parentFeature, Continuation); ContinuationList.Add(NewContinuation); } if (source.ElseInstructions.IsAssigned) { ElseInstructions = CSharpScope.Create(context, parentFeature, (IScope)source.ElseInstructions.Item); } }
/// <summary> /// Creates a new C# instruction. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly instruction from which the C# instruction is created.</param> public static ICSharpAsLongAsInstruction Create(ICSharpContext context, ICSharpFeature parentFeature, IAsLongAsInstruction source) { return(new CSharpAsLongAsInstruction(context, parentFeature, source)); }