Esempio n. 1
0
        public VarFixedBytes(AstElementaryTypeName type) : base(type)
        {
            // Determine the size of our fixed array.
            int sizeBytes = VarParser.GetFixedArraySizeInBytes(BaseType);

            // Initialize our bounds
            InitializeBounds(1, sizeBytes);
        }
Esempio n. 2
0
        public VarInt(AstElementaryTypeName type) : base(type)
        {
            // Obtain our size in bytes
            int sizeBytes = VarTypes.GetIntegerSizeInBytes(BaseType, GenericType);

            // Initialize our bounds
            InitializeBounds(1, sizeBytes);
        }
Esempio n. 3
0
 protected void Initialize(string name, AstElementaryTypeName astTypeName)
 {
     // Set our properties
     Name        = name;
     AstTypeName = astTypeName;
     BaseType    = VarParser.ParseTypeComponents(AstTypeName.TypeDescriptions.TypeString).baseType;
     GenericType = VarParser.GetGenericType(BaseType);
     ValueParser = VarParser.GetVariableObject(AstTypeName, VariableLocation);
 }
Esempio n. 4
0
        public VarBase(AstElementaryTypeName type)
        {
            // Set our type
            Type = type;

            // Obtain the components of our type and set them.
            BaseType = VarTypes.ParseTypeComponents(type.TypeDescriptions.TypeString).baseType;

            // Obtain our generic type.
            GenericType = VarTypes.GetGenericType(BaseType);
        }
Esempio n. 5
0
        protected void Initialize(string name, AstElementaryTypeName astTypeName, AstTypeDescriptions astTypeDescriptions = null)
        {
            // Set our generic var status.
            _isUndefinedType = astTypeName?.TypeDescriptions == null;

            // Override our optionally provided type descriptions with one from the ast type name, if available.
            TypeDescriptions = _isUndefinedType ? astTypeDescriptions : astTypeName.TypeDescriptions;

            // Initialize using whatever type provider is available
            Initialize(name, TypeDescriptions.TypeString);
        }
Esempio n. 6
0
 public VarRefBase(AstElementaryTypeName type) : base(type)
 {
 }
Esempio n. 7
0
 public VarAddress(AstElementaryTypeName type) : base(type)
 {
     // Initialize our bounds
     InitializeBounds(1, Address.SIZE);
 }
Esempio n. 8
0
 public VarBoolean(AstElementaryTypeName type) : base(type)
 {
     // Initialize our bounds
     InitializeBounds(1, 1);
 }
Esempio n. 9
0
 public VarString(AstElementaryTypeName type, VarLocation location) : base(type, location)
 {
 }
Esempio n. 10
0
 public VarDynamicBytes(AstElementaryTypeName type, VarLocation location) : base(type)
 {
     // Initialize our bounds.
     InitializeBounds(1, UInt256.SIZE, location);
 }
Esempio n. 11
0
 public StateVariable(string name, AstElementaryTypeName astTypeName)
 {
     // Initialize by name and type
     Initialize(name, astTypeName);
 }