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) ? 'extern ' : '') + ((t _and_ 2) ? 'readonly ' : '') + ((t _and_ 4) ? 'sealed ' : '') + ((t _and_ 8) ? 'static ' : '') + ((t _and_ 16) ? 'virtual ' : '') + ((t _and_ 32) ? 'volatile ' : '') // create a blocks of the element sys.create_blocks() // 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 property this._blk.println(len(this.level) ? this.level + ' ' : '', this.tMode, this.type, ' ', this.instance) .println(, '{').inc() // initialize method set if(linked("onSet")) sys.all_blocks_store() blk.inc() event("onSet", sub('value', this.typecode)) blk.dec() this._blk.println('set') .println('{').inc() sys.copy_blocks() this._blk.dec().println('}') sys.all_blocks_restore() end // initialize method get if(linked("onGet")) sys.all_blocks_store() blk.inc() event("onGet") blk.dec() this._blk.println('get') .println('{').inc() sys.copy_blocks() this._blk.dec().println('}') sys.all_blocks_restore() end this._blk.dec().println('}') // clean arr.clear() end func doReturn(data) blk.println('return ', data, ';') end func Value return(sub('value', this.typecode)) end func doProperty(value) blk.println(this.get_namespace(), '.', this.instance, ' = ', sys.to_type(value, this.typecode), ';') end func Property 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_ 8) namespace = code(el.cName) else namespace = code(el.instance) end else namespace = code(el.cName) + '.' + this.props("Namespace").value.instance end return(namespace) end