public static string ConvertQualifierValueInitializerAst(QualifierValueInitializerAst node, MofQuirks quirks = MofQuirks.None) { var source = new StringBuilder(); // e.g. // Description("an instance of a class that derives from the GOLF_Base class. ") source.Append("("); source.Append(AstMofGenerator.ConvertLiteralValueAst(node.Value, quirks)); source.Append(")"); return(source.ToString()); }
public static string ConvertLiteralValueArrayAst(LiteralValueArrayAst node, MofQuirks quirks = MofQuirks.None) { var source = new StringBuilder(); source.Append("{"); source.Append( string.Join( ", ", node.Values.Select(v => AstMofGenerator.ConvertLiteralValueAst(v, quirks)) ) ); source.Append("}"); return(source.ToString()); }
public static string ConvertPrimitiveTypeValueAst(PrimitiveTypeValueAst node, MofQuirks quirks = MofQuirks.None, string indent = "") { switch (node) { case LiteralValueAst ast: return(AstMofGenerator.ConvertLiteralValueAst(ast, quirks)); case LiteralValueArrayAst ast: return(AstMofGenerator.ConvertLiteralValueArrayAst(ast, quirks)); default: throw new NotImplementedException(); } }
public static string ConvertQualifierValueArrayInitializerAst(QualifierValueArrayInitializerAst node, MofQuirks quirks = MofQuirks.None) { var source = new StringBuilder(); // e.g. // OCL{"-- the key property cannot be NULL", "inv: InstanceId.size() = 10"} source.Append("{"); var index = 0; foreach (var value in node.Values) { if (index > 0) { source.Append(", "); } source.Append(AstMofGenerator.ConvertLiteralValueAst(value, quirks)); index++; } source.Append("}"); return(source.ToString()); }