public static string ToCobol85(this StorageAreaPropertySpecialRegister sa) { var str = new StringBuilder(); if (sa.SpecialRegisterName != null) { if (sa.SpecialRegisterName.TokenType == TokenType.ADDRESS) { str.Append("address of "); } else if (sa.SpecialRegisterName.TokenType == TokenType.LENGTH) { str.Append("length of "); } else { str.Append(sa.SpecialRegisterName.TokenType).Append(' '); } } if (sa.OtherStorageAreaReference != null) { str.Append(sa.OtherStorageAreaReference); } if (str.Length > 0) { return(str.ToString()); } return(sa.ToString()); }
/// <summary> /// Produce Cobol85 code which correspond of this StorageArea /// </summary> /// <param name="sa"></param> /// <returns></returns> public static string ToCobol85(this StorageArea sa) { StorageAreaPropertySpecialRegister specialRegister = sa as StorageAreaPropertySpecialRegister; if (specialRegister != null) { return(specialRegister.ToCobol85()); } return(sa.ToString()); }