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 value this.val = sys.get_typed_field('', 'Value', this.typecode) // 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 constant if(len(this.val)) this._blk.println(this.level, 'const ', this.type, ' ', this.instance, ' = ', this.val, ';') end // cleanup arr.clear() end func Const return(sub(this.instance, this.typecode)) end func Constant return(sub(code(this.parent.get_parent_sdk().cName) + '.' + this.instance, this.typecode)) end