Пример #1
0
        public static string ConvertMofProductionAst(MofProductionAst node, MofQuirks quirks = MofQuirks.None)
        {
            switch (node)
            {
            case CompilerDirectiveAst ast:
                return(AstMofGenerator.ConvertCompilerDirectiveAst(ast, quirks));

            case StructureDeclarationAst ast:
                return(AstMofGenerator.ConvertStructureDeclarationAst(ast, quirks));

            case ClassDeclarationAst ast:
                return(AstMofGenerator.ConvertClassDeclarationAst(ast, quirks));

            case AssociationDeclarationAst ast:
                return(AstMofGenerator.ConvertAssociationDeclarationAst(ast, quirks));

            case EnumerationDeclarationAst ast:
                return(AstMofGenerator.ConvertEnumerationDeclarationAst(ast, quirks));

            case InstanceValueDeclarationAst ast:
                return(AstMofGenerator.ConvertInstanceValueDeclarationAst(ast, quirks));

            case StructureValueDeclarationAst ast:
                return(AstMofGenerator.ConvertStructureValueDeclarationAst(ast, quirks));

            case QualifierTypeDeclarationAst ast:
                return(AstMofGenerator.ConvertQualifierTypeDeclarationAst(ast, quirks));

            default:
                throw new NotImplementedException();
            }
        }
Пример #2
0
        public static string ConvertStructureFeatureAst(IStructureFeatureAst node, MofQuirks quirks = MofQuirks.None, string indent = "")
        {
            switch (node)
            {
            case StructureDeclarationAst ast:
                return(AstMofGenerator.ConvertStructureDeclarationAst(ast, quirks, indent));

            case EnumerationDeclarationAst ast:
                return(AstMofGenerator.ConvertEnumerationDeclarationAst(ast, quirks, indent));

            case PropertyDeclarationAst ast:
                return(AstMofGenerator.ConvertPropertyDeclarationAst(ast, quirks));

            default:
                throw new NotImplementedException();
            }
        }