/// <summary> /// Initializes a new instance of the <see cref="CSharpContinuation"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly node from which the C# node is created.</param> protected CSharpContinuation(ICSharpContext context, ICSharpFeature parentFeature, IContinuation source) : base(source) { ParentFeature = parentFeature; Instructions = CSharpScope.Create(context, parentFeature, (IScope)source.Instructions); foreach (IInstruction Instruction in source.CleanupList) { ICSharpInstruction NewInstruction = CSharpInstruction.Create(context, parentFeature, Instruction); CleanupList.Add(NewInstruction); } }
/// <summary> /// Initializes a new instance of the <see cref="CSharpEffectiveBody"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly body from which the C# body is created.</param> protected CSharpEffectiveBody(ICSharpContext context, ICSharpFeature parentFeature, IEffectiveBody source) : base(context, parentFeature, source) { foreach (IInstruction Instruction in source.BodyInstructionList) { ICSharpInstruction NewInstruction = CSharpInstruction.Create(context, parentFeature, Instruction); BodyInstructionList.Add(NewInstruction); } ICSharpClass Owner = parentFeature.Owner; foreach (IEntityDeclaration Item in source.EntityDeclarationList) { ICSharpScopeAttributeFeature NewDeclaration = CSharpScopeAttributeFeature.Create(context, Owner, Item.ValidEntity.Item); EntityDeclarationList.Add(NewDeclaration); } }
/// <summary> /// Initializes a new instance of the <see cref="CSharpScope"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly node from which the C# node is created.</param> protected CSharpScope(ICSharpContext context, ICSharpFeature parentFeature, IScope source) : base(source) { ParentFeature = parentFeature; foreach (IEntityDeclaration Declaration in source.EntityDeclarationList) { ICSharpScopeAttributeFeature NewDeclaration = CSharpScopeAttributeFeature.Create(context, parentFeature.Owner, Declaration.ValidEntity.Item); EntityDeclarationList.Add(NewDeclaration); } foreach (IInstruction Instruction in source.InstructionList) { ICSharpInstruction NewInstruction = CSharpInstruction.Create(context, parentFeature, Instruction); InstructionList.Add(NewInstruction); } }