Пример #1
0
        public static string ConvertAssociationDeclarationAst(AssociationDeclarationAst node, MofQuirks quirks = MofQuirks.None, string indent = "")
        {
            var source = new StringBuilder();

            if (node.QualifierList.QualifierValues.Any())
            {
                source.AppendLine(AstMofGenerator.ConvertQualifierListAst(node.QualifierList, quirks));
                source.Append(indent);
            }
            source.Append($"{Constants.ASSOCIATION} {node.AssociationName.Name}");
            if (node.SuperAssociation != null)
            {
                source.Append($" : {node.SuperAssociation.Name}");
            }
            source.AppendLine();
            source.Append(indent);
            source.AppendLine("{");
            foreach (var classFeature in node.ClassFeatures)
            {
                source.Append(indent);
                source.Append("\t");
                source.AppendLine(AstMofGenerator.ConvertClassFeatureAst(classFeature, quirks, indent + '\t'));
            }
            source.Append(indent);
            source.Append("};");
            return(source.ToString());
        }