func init // initialize instance if(isdef("Name")) this.setfield('instance', this.codename) else this.setfield('instance', code(this.props("Name").value)) end // defines level this.level = isdef("AccessModifier") ? '' : lower(this.props("AccessModifier").value) + ' ' // defines type this.type = code(this.props("Type").value) this.typecode = sys.type_code(this.type) // defines type modifier t = this.props("TypeModifier").value this.tMode = ((t _and_ 1) ? 'readonly ' : '') + ((t _and_ 2) ? 'static ' : '') + ((t _and_ 4) ? 'virtual ' : '') + ((t _and_ 8) ? 'volatile ' : '') // set a block of the element this.setfield('_blk', block.reggen())._blk.inc().inc() // defines comments if(not isdef("Comment")) arr = this.props("Comment").value for(i = 0; i < arr.size(); i++) this._blk.println('/// ', code(arr.get(i))) end end // defines attributes if(not isdef("Attributes")) arr = this.props("Attributes").value attr = code(arr.join(',')) this._blk.println('[', attr, ']') end // declares field if(isdef("Default") and not linked("Default")) _default = '' else _default = ' = ' + sys.get_typed_field('null', 'Default', this.typecode) end this._blk.println(this.level, this.tMode, this.type, ' ', this.instance, _default, ';') // clean arr.clear() end func doSet(data) blk.println(this.instance, ' = ', sys.to_type(d("Value"), this.typecode), ';') end func Get return(sub(this.instance, this.typecode)) end func doField(value) blk.println(this.get_namespace(), '.', this.instance, ' = ', sys.to_type(value, this.typecode), ';') end func Field return(sub(this.get_namespace() + '.' + this.instance, this.typecode)) end func get_namespace() el = this.parent.get_parent_sdk() if(isdef("Namespace")) if(this.props("TypeModifier").value _and_ 2) namespace = code(el.cName) else namespace = code(el.instance) end else namespace = code(el.cName) + '.' + this.props("Namespace").value.instance end return(namespace) end