func init // 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 ' : '') // defines params types if(not isdef("Types")) this.types = this.props("Types").value end // defines params if(this.numvars) pname = code(this.pt_var(0).name) ptype = code(this.types.get(0)) params = ptype + ' ' + pname for(n = 1; n < this.numvars; n++) pname = code(this.pt_var(n).name) ptype = code(this.types.get(n)) params += ', ' + ptype + ' ' + pname end // initialize params methods for(i = 0; i < this.numvars; i++) method(code(this.pt_var(i).name)) pname = cgt.get_func_name() pcodename = code(pname) return(sub(pcodename, sys.type_code(this.get_type(pname)))) end end end // 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 indexer this._blk.println(len(this.level) ? this.level + ' ' : '', this.tMode, this.type, ' this[', code(params), ']') .println(, '{').inc() // 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 // 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() if(not blk_lvars.empty()) this._blk.copyhere(blk_lvars) end sys.copy_blocks() this._blk.dec().println('}') sys.all_blocks_restore() end this._blk.dec().println('}') // cleanup arr.clear() end func doReturn(data) blk.println('return ', data, ';') end func get_type(pname) return(this.types.get(1 + code(copy(pname, 1)) - 2)) end