public override IdpeMessage Parse(bool onlyConstraints) { try { if (base.Value.ToUpper() != "NULL") { this._ParseResult = new IdpeMessage(IdpeMessageCodes.IDPE_SUCCESS); if (ValueInt == null) { TryExtractingSpecificType(); if (ValueInt == null) //still null, then throw { this._ParseResult = new IdpeMessage(IdpeMessageCodes.IDPE_INT_TYPE_DATA_VALIDATION_FAILED); this._ParseResult.Message = string.Format(this._ParseResult.Message, PrintRowColPosition(), Type, base.Value); return(this._ParseResult); } } Value = ValueInt.ToString(); CheckConstraints(); } } catch (Exception ex) { ExtensionMethods.TraceError(ex.ToString()); this._ParseResult = new IdpeMessage(IdpeMessageCodes.IDPE_INT_TYPE_DATA_VALIDATION_FAILED); this._ParseResult.Message = string.Format(this._ParseResult.Message, PrintRowColPosition(), Type, base.Value); } _IsParsed = true; return(this._ParseResult); }
public string GetDisplayableValue() { if (ValueInt != null) { return(ValueInt.ToString()); } if (ValueFloat != null) { return(ValueFloat.ToString()); } if (ValueCol != null) { return(ValueCol.ToString()); } return("#unimplemented value"); }
public override string ToPromela() { return(Attribute.ToPromela() + " = " + (Value == null ? ValueInt.ToString() : Value.ToPromela()) + ";"); }