コード例 #1
0
        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);
        }
コード例 #2
0
        public string GetDisplayableValue()
        {
            if (ValueInt != null)
            {
                return(ValueInt.ToString());
            }

            if (ValueFloat != null)
            {
                return(ValueFloat.ToString());
            }

            if (ValueCol != null)
            {
                return(ValueCol.ToString());
            }

            return("#unimplemented value");
        }
コード例 #3
0
 public override string ToPromela()
 {
     return(Attribute.ToPromela() + " = " + (Value == null ? ValueInt.ToString() : Value.ToPromela()) + ";");
 }