UNPKG

protobytes

Version:

A simplified implementation of serialization and deserialization of binary communication protocols: including runtime dependency libraries for each language and command-line compilation tools for protocol files.

2 lines 95.8 kB
#!/usr/bin/env node (()=>{var t={633:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.supportLanguage=e.LanguageType=void 0,(r=o=e.LanguageType||(e.LanguageType={})).JAVA="java",r.DART="dart";var o,r,n=[o.DART,o.JAVA];e.supportLanguage=function(t){return-1!=n.indexOf(t)}},522:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compile=void 0;var r=o(458),n=o(275),i=o(691),s=o(3),a=o(17),c=(h.prototype.run=function(t){this.config=t,this.syntaxNodeTree=new i.SyntaxNodeTree,this.syntaxAnalys(),this.generate()},h.prototype.syntaxAnalys=function(){var t=this;(0,s.search)(this.config.sourceDir,"proto").forEach((function(e){e=(0,s.readFile)(e),n.syntaxAnalyzer.analyse(e,t.syntaxNodeTree)}))},h.prototype.generate=function(){var t=this;this.config.outputs.forEach((function(e){e.clear&&(0,s.removeDir)(e.dir);var o=(0,r.getGenerators)(e.type);o.init(e.author,e.package,e.packageLib),t.syntaxNodeTree.beans.forEach((function(t){o.voGenerator.decode(t),(0,s.writeFile)(a.join(e.dir,"/infos"),o.voGenerator.name,o.voGenerator.code)})),o.buffConvertor&&(o.buffConvertor.decode(t.syntaxNodeTree.beans),(0,s.writeFile)(a.join(e.dir,"/utils"),o.buffConvertor.name,o.buffConvertor.code)),o.buffListConvertor&&(o.buffListConvertor.decode(t.syntaxNodeTree.beans),(0,s.writeFile)(a.join(e.dir,"/utils"),o.buffListConvertor.name,o.buffListConvertor.code))}))},h);function h(){}e.compile=function(t){(new c).run(t)}},138:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createConfigTemplate=e.createProtoTemplate=void 0;var r=o(17),n=o(483),i=o(3);e.createProtoTemplate=function(t,e){return t=r.join(t,e),(0,i.writeFile)(t,n.protoTemplate),t},e.createConfigTemplate=function(t,e){return t=r.join(t,e),(0,i.writeFile)(t,n.configTemplate),t}},608:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeTokenizer=void 0;var r=o(300);function n(t){this.atts=[],this.words=t,this.analyseAttributes()}n.prototype.analyseAttributes=function(){var t,e;this.words.length<2||(t=new r.AttributeNode,e=!1,3<=this.words.length?(2<this.words[0].word.length&&"/"==this.words[0].word.charAt(0)&&"/"==this.words[0].word.charAt(1)&&"/"==this.words[0].word.charAt(2)&&(t.note=this.words[0].word.slice(3),t.name=this.words[2].word,t.type=this.words[1].word,e=!0),2<this.words[2].word.length&&"/"==this.words[2].word.charAt(0)&&"/"==this.words[2].word.charAt(1)&&"/"==this.words[2].word.charAt(2)&&this.words[0].row==this.words[1].row&&this.words[1].row==this.words[2].row&&(t.note=this.words[2].word.slice(3),t.type=this.words[0].word,t.name=this.words[1].word,e=!0),e||(t.type=this.words[0].word,t.name=this.words[1].word)):2<=this.words.length&&(t.type=this.words[0].word,t.name=this.words[1].word),this.words=e?this.words.slice(3):this.words.slice(2),0==t.type.indexOf("List<")&&(t.isList=!0,t.type=t.type.slice(5,t.type.length-1)),this.atts.push(t),this.analyseAttributes())},n.prototype.getResult=function(){return this.atts},e.AttributeTokenizer=n},160:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BeanTokenizer=void 0;var r=o(608),n=o(288);function i(t){this.words=t,this.beanNode=new n.BeanNode;for(var e=!1,o=(2<this.words[0].word.length&&"/"==this.words[0].word.charAt(0)&&"/"==this.words[0].word.charAt(1)&&"/"==this.words[0].word.charAt(2)?(this.beanNode.note=this.words[0].word.slice(3).trim(),this.beanNode.name=this.words[2].word.trim(),e=!0):2<this.words[2].word.length&&"/"==this.words[2].word.charAt(0)&&"/"==this.words[2].word.charAt(1)&&"/"==this.words[2].word.charAt(2)?(this.beanNode.note=this.words[2].word.slice(3).trim(),this.beanNode.name=this.words[1].word.trim(),e=!0):2<this.words[3].word.length&&"/"==this.words[3].word.charAt(0)&&"/"==this.words[3].word.charAt(1)&&"/"==this.words[3].word.charAt(2)&&(this.beanNode.note=this.words[3].word.slice(3),this.beanNode.name=this.words[1].word.trim(),e=!0),e||(this.beanNode.name=this.words[1].word),0),r=0,i=0;i<this.words.length;i++)"{"==this.words[i].word&&(o=i),"}"==this.words[i].word&&(r=i);this.words=t.slice(o+1,r),this.analyseAttributes()}i.prototype.analyseAttributes=function(){var t=new r.AttributeTokenizer(this.words);this.beanNode.attList=t.getResult()},i.prototype.getResult=function(){return this.beanNode},e.BeanTokenizer=i},45:(t,e)=>{"use strict";function o(){this._code=""}Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGenerator=void 0,o.prototype.init=function(t,e,o){this._author=t,this._packageDes=e,o&&(this._packageLib=o)},Object.defineProperty(o.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"code",{get:function(){return this._code},enumerable:!1,configurable:!0}),e.CodeGenerator=o},993:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=(Object.defineProperty(e,"__esModule",{value:!0}),e.DartBuffConvertorGenerator=void 0,o(787));function a(){return null!==n&&n.apply(this,arguments)||this}o=o(305),i(a,n=o.DartCodeGenerator),a.prototype.decode=function(t){var e="BuffConverter",o=(this._name=(0,s.getConstLowerStr)(e),[this._packageLib+"buffers/core/buffs.dart",this._packageLib+"buffers/core/i_buff_info.dart",this._packageLib+"buffers/utils/buff_converter_base.dart"]);this.containList(t)&&o.push(this._packageDes+"utils/buff_list_converter.dart");for(var r=0;r<t.length;r++){var n=(0,s.getConstLowerStr)(t[r].name);o.push(this._packageDes+"infos/"+n+".dart")}for(this._code+=this.getDocHelper().getImport(o,0),this._code+="\n",this._code+=this.getDocHelper().getClassDoc("Buff转换器",0,this._author),this._code+="class "+e+" extends BuffConverterBase {\n",this._code+=this.getDocHelper().getIndent(1)+"static "+e+"? _instance;\n",this._code+=this.getDocHelper().getIndent(1)+"static "+e+" get instance {\n",this._code+=this.getDocHelper().getIndent(2)+"_instance ??= "+e+"();\n",this._code+=this.getDocHelper().getIndent(2)+"return _instance!;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",r=0;r<t.length;r++){var i,a=t[r].attList;this._code+=this.getDocHelper().getFuncDoc("从Buff中获取"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1),1,[{name:"key",notes:"该"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info的Key值"},{name:"buff",notes:"获取自的Buff"}],"获取的"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)),this._code+=this.getDocHelper().getIndent(1)+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+" "+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+"FromBuff(String key, IBuffInfo buff) {\n",this._code+=this.getDocHelper().getIndent(2)+"buff.key = key;\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> atts = (buff as BuffObject).attributes;\n",this._code+=this.getDocHelper().getIndent(2)+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+" target = "+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"();\n";for(var c=0;c<a.length;c++)this._code+=0==c?this.getDocHelper().getIndent(2)+"if (atts.isNotEmpty) {\n":this.getDocHelper().getIndent(2)+"if ("+c+" < atts.length) {\n",i=this.getTypeConvertor().hasType(a[c].type)?a[c].type:a[c].type.charAt(0).toLocaleLowerCase()+a[c].type.slice(1),a[c].isList?this._code+=this.getDocHelper().getIndent(3)+"target."+a[c].name+" = BuffListConverter.instance."+i+'ListFromBuff("'+a[c].name+'", atts['+c+"]);\n":this._code+=this.getDocHelper().getIndent(3)+"target."+a[c].name+" = BuffConverter.instance."+i+'FromBuff("'+a[c].name+'", atts['+c+"]);\n",this._code+=this.getDocHelper().getIndent(2)+"}\n";for(this._code+=this.getDocHelper().getIndent(2)+"return target;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getFuncDoc("将一个"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info转换成Buff",1,[{name:"target",notes:"需要转换的"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)},{name:"key",notes:"该"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info的Key值"}],"转换得到的BuffObject"),this._code+=this.getDocHelper().getIndent(1)+"BuffObject "+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+"ToBuff("+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+" target, String key) {\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = BuffObject();\n",this._code+=this.getDocHelper().getIndent(2)+"buff.key = key;\n",c=0;c<a.length;c++)i=this.getTypeConvertor().hasType(a[c].type)?a[c].type:a[c].type.charAt(0).toLocaleLowerCase()+a[c].type.slice(1),a[c].isList?this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffListConverter.instance."+i+"ListToBuff(target."+a[c].name+', "'+a[c].name+'"));\n':this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffConverter.instance."+i+"ToBuff(target."+a[c].name+', "'+a[c].name+'"));\n';this._code+=this.getDocHelper().getIndent(2)+"return buff;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n"}this._code+="}\n"},a.prototype.containList=function(t){for(var e=!1,o=0;o<t.length;o++){for(var r=0;r<t[o].attList.length;r++)if(t[o].attList[r].isList){e=!0;break}if(e)break}return e},o=a,e.DartBuffConvertorGenerator=o},736:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=(Object.defineProperty(e,"__esModule",{value:!0}),e.DartBuffListConvertorGenerator=void 0,o(787));function a(){return null!==n&&n.apply(this,arguments)||this}o=o(305),i(a,n=o.DartCodeGenerator),a.prototype.decode=function(t){for(var e="BuffListConverter",o=(this._name=(0,s.getConstLowerStr)(e),[this._packageLib+"buffers/core/buffs.dart",this._packageLib+"buffers/core/i_buff_info.dart",this._packageLib+"buffers/utils/buff_list_converter_base.dart",this._packageDes+"/utils/buff_converter.dart"]),r=0;r<t.length;r++){var n=(0,s.getConstLowerStr)(t[r].name);o.push(this._packageDes+"infos/"+n+".dart")}for(this._code+=this.getDocHelper().getImport(o,0),this._code+="\n",this._code+=this.getDocHelper().getClassDoc("Buff转换器",0,this._author),this._code+="class "+e+" extends BuffListConverterBase {\n",this._code+=this.getDocHelper().getIndent(1)+"static "+e+"? _instance;\n",this._code+=this.getDocHelper().getIndent(1)+"static "+e+" get instance {\n",this._code+=this.getDocHelper().getIndent(2)+"_instance ??= "+e+"();\n",this._code+=this.getDocHelper().getIndent(2)+"return _instance!;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",r=0;r<t.length;r++)this._code+=this.getDocHelper().getFuncDoc("从Buff中获取"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info的列表",1,[{name:"key",notes:"该"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info列表的Key值"},{name:"buff",notes:"获取自的Buff"}],"获取的"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"列表"),this._code+=this.getDocHelper().getIndent(1)+"List<"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"> "+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+"ListFromBuff(String key, IBuffInfo buff) {\n",this._code+=this.getDocHelper().getIndent(2)+"buff.key = key;\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> items = (buff as BuffList).items;\n",this._code+=this.getDocHelper().getIndent(2)+"List<"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"> target = [];\n",this._code+=this.getDocHelper().getIndent(2)+"for (int i = 0; i < items.length; i++){\n",this._code+=this.getDocHelper().getIndent(3)+"target.add(BuffConverter.instance."+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+'FromBuff("", items[i]));\n',this._code+=this.getDocHelper().getIndent(2)+"}\n",this._code+=this.getDocHelper().getIndent(2)+"return target;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getFuncDoc("将一个"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info的列表转换成Buff",1,[{name:"target",notes:"需要转换的"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info列表"},{name:"key",notes:"该"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"Info列表的Key值"}],"转换得到的BuffList"),this._code+=this.getDocHelper().getIndent(1)+"BuffList "+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+"ListToBuff(List<"+t[r].name.charAt(0).toLocaleUpperCase()+t[r].name.slice(1)+"> target,String key) {\n",this._code+=this.getDocHelper().getIndent(2)+"BuffList buff = BuffList();\n",this._code+=this.getDocHelper().getIndent(2)+"buff.key = key;\n",this._code+=this.getDocHelper().getIndent(2)+"for(int i = 0; i<target.length; i++){\n",this._code+=this.getDocHelper().getIndent(3)+"buff.push(BuffConverter.instance."+t[r].name.charAt(0).toLocaleLowerCase()+t[r].name.slice(1)+'ToBuff(target[i], ""));\n',this._code+=this.getDocHelper().getIndent(2)+"}\n",this._code+=this.getDocHelper().getIndent(2)+"return buff;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n";this._code+="}\n"},o=a,e.DartBuffListConvertorGenerator=o},305:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=(Object.defineProperty(e,"__esModule",{value:!0}),e.DartCodeGenerator=void 0,o(633)),a=o(434),c=o(939);function h(){var t=n.call(this)||this;return t.getDocHelper=function(){return(0,a.getDocHelper)(a.DocType.DART_DOC)},t.getTypeConvertor=function(){return(0,c.getTypeConvertor)(s.LanguageType.DART)},t._packageLib="proto_bytes/com/protobytes/",t}o=o(45),i(h,n=o.CodeGenerator),h.prototype.init=function(t,e,o){n.prototype.init.call(this,t,e,o),this._packageDes&&(this._packageDes=this._packageDes.replace(/\\/g,"/")),this._packageDes&&"/"!=this._packageDes.charAt(this._packageDes.length-1)&&(this._packageDes+="/"),this._packageLib&&(this._packageLib=this._packageLib.replace(/\\/g,"/")),this._packageLib&&"/"!=this._packageLib.charAt(this._packageLib.length-1)&&(this._packageLib+="/")},Object.defineProperty(h.prototype,"name",{get:function(){return this._name+".dart"},enumerable:!1,configurable:!0}),o=h,e.DartCodeGenerator=o},117:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=(Object.defineProperty(e,"__esModule",{value:!0}),e.DartVOGenerator=void 0,o(787));function a(){return null!==n&&n.apply(this,arguments)||this}o=o(305),i(a,n=o.DartCodeGenerator),a.prototype.decode=function(t){this._name=(0,s.getConstLowerStr)(t.name);for(var e=t.name.charAt(0).toLocaleUpperCase()+t.name.slice(1),o=(this._code="",[this._packageLib+"buffers/core/i_buff_info.dart",this._packageLib+"buffers/core/buffs.dart",this._packageLib+"buffers/utils/buff_bytes_util.dart",this._packageLib+"utils/byte_array.dart"]),r=(this.containNormal(t)&&o.push(this._packageDes+"utils/buff_converter.dart"),this.containList(t)&&o.push(this._packageDes+"utils/buff_list_converter.dart"),{}),n=0;n<t.attList.length;n++)this.getTypeConvertor().hasType(t.attList[n].type)||r[t.attList[n].type]||(o.push(this._packageDes+"infos/"+(0,s.getConstLowerStr)(t.attList[n].type)+".dart"),r[t.attList[n].type]=!0);var i,a;for(this._code+=this.getDocHelper().getImport(o,0),this._code+="\n",this._code+=this.getDocHelper().getClassDoc(t.note,0,this._author),this._code+="class "+e+" {\n",n=0;n<t.attList.length;n++)t.attList[n].note&&(this._code+=this.getDocHelper().getAttrDoc(t.attList[n].note,1)),t.attList[n].isList?(i=this.getTypeConvertor().hasType(t.attList[n].type)?"List<"+this.getTypeConvertor().convertTypeTo(t.attList[n].type,!0)+">":"List<"+t.attList[n].type.charAt(0).toLocaleUpperCase()+t.attList[n].type.slice(1)+">",this._code+=this.getDocHelper().getIndent(1)+i+" "+t.attList[n].name+" = [];\n"):(i=this.getTypeConvertor().hasType(t.attList[n].type)?this.getTypeConvertor().convertTypeTo(t.attList[n].type):t.attList[n].type.charAt(0).toLocaleUpperCase()+t.attList[n].type.slice(1),this._code+=this.getDocHelper().getIndent(1)+i+" "+t.attList[n].name,a=this.getTypeConvertor().hasType(t.attList[n].type)?this.getTypeConvertor().getDefaultValue(i):"",this._code+=a?" = "+a+";\n":" = "+i+"();\n"),this._code+="\n";this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"static "+e+" fromBytes(List<int> bytes) {\n",this._code+=this.getDocHelper().getIndent(2)+"ByteArray byteArray = ByteArray(bytes);\n",this._code+=this.getDocHelper().getIndent(2)+"byteArray.position = 0;\n",this._code+=this.getDocHelper().getIndent(2)+e+" info = "+e+"();\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = BuffBytesUtil.fromBytes(byteArray) as BuffObject;\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> atts = buff.attributes;\n";for(var c=0;c<t.attList.length;c++)this._code+=0==c?this.getDocHelper().getIndent(2)+"if (atts.isNotEmpty) {\n":this.getDocHelper().getIndent(2)+"if ("+c+" < atts.length) {\n",i=this.getTypeConvertor().hasType(t.attList[c].type)?t.attList[c].type:t.attList[c].type.charAt(0).toLocaleLowerCase()+t.attList[c].type.slice(1),t.attList[c].isList?this._code+=this.getDocHelper().getIndent(3)+"info."+t.attList[c].name+" = BuffListConverter.instance."+i+'ListFromBuff("'+t.attList[c].name+'", atts['+c+"]);\n":this._code+=this.getDocHelper().getIndent(3)+"info."+t.attList[c].name+" = BuffConverter.instance."+i+'FromBuff("'+t.attList[c].name+'", atts['+c+"]);\n",this._code+=this.getDocHelper().getIndent(2)+"}\n";for(this._code+=this.getDocHelper().getIndent(2)+"return info;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"static List<int> toBytes("+e+" info) {\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = BuffObject();\n",c=0;c<t.attList.length;c++)i=this.getTypeConvertor().hasType(t.attList[c].type)?t.attList[c].type:t.attList[c].type.charAt(0).toLocaleLowerCase()+t.attList[c].type.slice(1),t.attList[c].isList?this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffListConverter.instance."+i+"ListToBuff(info."+t.attList[c].name+', "'+t.attList[c].name+'"));\n':this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffConverter.instance."+i+"ToBuff(info."+t.attList[c].name+', "'+t.attList[c].name+'"));\n';this._code+=this.getDocHelper().getIndent(2)+"ByteArray bytes = BuffBytesUtil.toBytes(buff);\n",this._code+=this.getDocHelper().getIndent(2)+"return bytes.bytes;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="}\n"},a.prototype.checkHasByteArray=function(t){for(var e=0;e<t.attList.length;e++)if(t.attList[e].isList){if(this.getTypeConvertor().hasType(t.attList[e].type)&&"ByteArray"==this.getTypeConvertor().convertTypeTo(t.attList[e].type,!0))return!0}else if(this.getTypeConvertor().hasType(t.attList[e].type)&&"ByteArray"==this.getTypeConvertor().convertTypeTo(t.attList[e].type))return!0;return!1},a.prototype.containList=function(t){for(var e=0;e<t.attList.length;e++)if(t.attList[e].isList)return!0;return!1},a.prototype.containNormal=function(t){for(var e=!1,o=0;o<t.attList.length;o++)if(!t.attList[o].isList){e=!0;break}return e},o=a,e.DartVOGenerator=o},458:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGenerators=void 0;var r=o(633),n=o(993),i=o(736),s=o(117),a=o(29),c=o(784),h=o(215);function l(){this.buffConvertor=new a.JavaBuffConvertorGenerator,this.buffListConvertor=new c.JavaBuffListConvertorGenerator,this.voGenerator=new h.JavaVOGenerator}l.prototype.init=function(t,e,o){this.buffConvertor.init(t,e,o),this.buffListConvertor.init(t,e,o),this.voGenerator.init(t,e,o)},o=l,u.prototype.init=function(t,e,o){this.buffConvertor.init(t,e,o),this.buffListConvertor.init(t,e,o),this.voGenerator.init(t,e,o)};var p=u;function u(){this.buffConvertor=new n.DartBuffConvertorGenerator,this.buffListConvertor=new i.DartBuffListConvertorGenerator,this.voGenerator=new s.DartVOGenerator}var d={};d[r.LanguageType.JAVA]=new o,d[r.LanguageType.DART]=new p,e.getGenerators=function(t){return d[t]}},29:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});function s(){return null!==n&&n.apply(this,arguments)||this}Object.defineProperty(e,"__esModule",{value:!0}),e.JavaBuffConvertorGenerator=void 0,o=o(968),i(s,n=o.JavaCodeGenerator),s.prototype.decode=function(t){this._name="BuffConverter",this._code="package "+(this._packageDes?this._packageDes+".":""),this._code+="utils;\n",this._code+="\n",this._code+="import java.util.List;\n",this._code+="\n",this._code+="import "+(this._packageDes?this._packageDes+".":"")+"infos.*;\n",this._code+="import "+this._packageLib+".buffers.core.BuffObject;\n",this._code+="import "+this._packageLib+".buffers.core.commons.IBuffInfo;\n",this._code+="import "+this._packageLib+".buffers.utils.BuffConverterBase;\n",this._code+="\n",this._code+=this.getDocHelper().getClassDoc("Buff转换器",0,this._author),this._code+="public class "+this._name+" extends BuffConverterBase {\n",this._code+=this.getDocHelper().getIndent()+"private static "+this._name+" _instance;\n",this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"public static "+this._name+" getInstance() {\n",this._code+=this.getDocHelper().getIndent(2)+"if (_instance == null)\n",this._code+=this.getDocHelper().getIndent(3)+"_instance = new "+this._name+"();\n",this._code+=this.getDocHelper().getIndent(2)+"return _instance;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n";for(var e=0;e<t.length;e++){var o,r=t[e].attList;this._code+=this.getDocHelper().getFuncDoc("从Buff中获取"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1),1,[{name:"key",notes:"该"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info的Key值"},{name:"buff",notes:"获取自的Buff"}],"获取的"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)),this._code+=this.getDocHelper().getIndent(1)+"public "+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+" "+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+"FromBuff(String key, IBuffInfo buff) {\n",this._code+=this.getDocHelper().getIndent(2)+"buff.setKey(key);\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> atts = ((BuffObject) buff).getAttributes();\n",this._code+=this.getDocHelper().getIndent(2)+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+" target = new "+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"();\n";for(var n=0;n<r.length;n++)this._code+=this.getDocHelper().getIndent(2)+"if ("+n+" < atts.size())\n",o=this.getTypeConvertor().hasType(r[n].type)?r[n].type:r[n].type.charAt(0).toLocaleLowerCase()+r[n].type.slice(1),r[n].isList?this._code+=this.getDocHelper().getIndent(3)+"target."+r[n].name+" = BuffListConverter.getInstance()."+o+'ListFromBuff("'+r[n].name+'", atts.get('+n+"));\n":this._code+=this.getDocHelper().getIndent(3)+"target."+r[n].name+" = BuffConverter.getInstance()."+o+'FromBuff("'+r[n].name+'", atts.get('+n+"));\n";for(this._code+=this.getDocHelper().getIndent(2)+"return target;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getFuncDoc("将一个"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info转换成Buff",1,[{name:"target",notes:"需要转换的"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)},{name:"key",notes:"该"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info的Key值"}],"转换得到的BuffObject"),this._code+=this.getDocHelper().getIndent(1)+"public BuffObject "+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+"ToBuff("+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+" target, String key) {\n",this._code+=this.getDocHelper().getIndent(2)+"if (target == null)\n",this._code+=this.getDocHelper().getIndent(3)+"target = new "+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"();\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = new BuffObject();\n",this._code+=this.getDocHelper().getIndent(2)+"buff.setKey(key);\n",n=0;n<r.length;n++)o=this.getTypeConvertor().hasType(r[n].type)?r[n].type:r[n].type.charAt(0).toLocaleLowerCase()+r[n].type.slice(1),r[n].isList?this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffListConverter.getInstance()."+o+"ListToBuff(target."+r[n].name+', "'+r[n].name+'"));\n':this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffConverter.getInstance()."+o+"ToBuff(target."+r[n].name+', "'+r[n].name+'"));\n';this._code+=this.getDocHelper().getIndent(2)+"return buff;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n"}this._code+="}\n"},o=s,e.JavaBuffConvertorGenerator=o},784:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});function s(){return null!==n&&n.apply(this,arguments)||this}Object.defineProperty(e,"__esModule",{value:!0}),e.JavaBuffListConvertorGenerator=void 0,o=o(968),i(s,n=o.JavaCodeGenerator),s.prototype.decode=function(t){this._name="BuffListConverter",this._code="package "+(this._packageDes?this._packageDes+".":""),this._code+="utils;\n",this._code+="\n",this._code+="import java.util.ArrayList;\n",this._code+="import java.util.List;\n",this._code+="\n",this._code+="import "+(this._packageDes?this._packageDes+".":"")+"infos.*;\n",this._code+="import "+this._packageLib+".buffers.core.BuffList;\n",this._code+="import "+this._packageLib+".buffers.core.commons.IBuffInfo;\n",this._code+="import "+this._packageLib+".buffers.utils.BuffListConverterBase;\n",this._code+="\n",this._code+=this.getDocHelper().getClassDoc("BuffList转换器",0,this._author),this._code+="public class "+this._name+" extends BuffListConverterBase {\n",this._code+=this.getDocHelper().getIndent(1)+"private static "+this._name+" _instance;\n",this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"public static "+this._name+" getInstance() {\n",this._code+=this.getDocHelper().getIndent(2)+"if (_instance == null)\n",this._code+=this.getDocHelper().getIndent(3)+"_instance = new "+this._name+"();\n",this._code+=this.getDocHelper().getIndent(2)+"return _instance;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n";for(var e=0;e<t.length;e++)this._code+=this.getDocHelper().getFuncDoc("从Buff中获取"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info的列表",1,[{name:"key",notes:"该"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info列表的Key值"},{name:"buff",notes:"获取自的Buff"}],"获取的"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"列表"),this._code+=this.getDocHelper().getIndent(1)+"public List<"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"> "+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+"ListFromBuff(String key, IBuffInfo buff) {\n",this._code+=this.getDocHelper().getIndent(2)+"buff.setKey(key);\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> items = ((BuffList) buff).getItems();\n",this._code+=this.getDocHelper().getIndent(2)+"List<"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"> target = new ArrayList<"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+">();\n",this._code+=this.getDocHelper().getIndent(2)+"for (int i = 0; i < items.size(); i++)\n",this._code+=this.getDocHelper().getIndent(3)+"target.add(BuffConverter.getInstance()."+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+'FromBuff("", items.get(i)));\n',this._code+=this.getDocHelper().getIndent(2)+"return target;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getFuncDoc("将一个"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info的列表转换成Buff",1,[{name:"target",notes:"需要转换的"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info列表"},{name:"key",notes:"该"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"Info列表的Key值"}],"转换得到的BuffList"),this._code+=this.getDocHelper().getIndent(1)+"public BuffList "+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+"ListToBuff(List<"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+"> target,String key) {\n",this._code+=this.getDocHelper().getIndent(2)+"if (target == null)\n",this._code+=this.getDocHelper().getIndent(3)+"target = new ArrayList<"+t[e].name.charAt(0).toLocaleUpperCase()+t[e].name.slice(1)+">();\n",this._code+=this.getDocHelper().getIndent(2)+"BuffList buff = new BuffList();\n",this._code+=this.getDocHelper().getIndent(2)+"buff.setKey(key);\n",this._code+=this.getDocHelper().getIndent(2)+"for(int i = 0; i<target.size(); i++)\n",this._code+=this.getDocHelper().getIndent(3)+"buff.push(BuffConverter.getInstance()."+t[e].name.charAt(0).toLocaleLowerCase()+t[e].name.slice(1)+'ToBuff(target.get(i), ""));\n',this._code+=this.getDocHelper().getIndent(2)+"return buff;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n";this._code+="}\n"},o=s,e.JavaBuffListConvertorGenerator=o},968:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=(Object.defineProperty(e,"__esModule",{value:!0}),e.JavaCodeGenerator=void 0,o(633)),a=o(434),c=o(939);function h(){var t=n.call(this)||this;return t.getDocHelper=function(){return(0,a.getDocHelper)(a.DocType.JAVA_DOC)},t.getTypeConvertor=function(){return(0,c.getTypeConvertor)(s.LanguageType.JAVA)},t._packageLib="com.protobytes",t}o=o(45),i(h,n=o.CodeGenerator),Object.defineProperty(h.prototype,"name",{get:function(){return this._name+".java"},enumerable:!1,configurable:!0}),o=h,e.JavaCodeGenerator=o},215:function(t,e,o){"use strict";var r,n,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});function s(){return null!==n&&n.apply(this,arguments)||this}Object.defineProperty(e,"__esModule",{value:!0}),e.JavaVOGenerator=void 0,o=o(968),i(s,n=o.JavaCodeGenerator),s.prototype.decode=function(t){this._name=t.name.charAt(0).toLocaleUpperCase()+t.name.slice(1),this._code="package "+(this._packageDes?this._packageDes+".":""),this._code+="infos;\n",this._code+="\n",this.checkHasList(t)&&(this._code+="import java.util.ArrayList;\n"),this._code+="import java.util.List;\n",this._code+="import "+this._packageLib+".buffers.core.*;\n",this._code+="import "+this._packageLib+".buffers.core.commons.*;\n",this._code+="import "+(this._packageDes?this._packageDes+".":"")+"utils.BuffConverter;\n",this.checkHasList(t)&&(this._code+="import "+(this._packageDes?this._packageDes+".":"")+"utils.BuffListConverter;\n"),this._code+="import "+this._packageLib+".buffers.utils.BuffBytesUtil;\n",this._code+="import "+this._packageLib+".utils.ByteArray;\n",this._code+="\n",this._code+=this.getDocHelper().getClassDoc(t.note,0,this._author),this._code+="public class "+this._name+" {\n";for(var e,o,r=0;r<t.attList.length;r++)t.attList[r].note&&(this._code+=this.getDocHelper().getAttrDoc(t.attList[r].note,1)),t.attList[r].isList?(e=this.getTypeConvertor().hasType(t.attList[r].type)?"List<"+this.getTypeConvertor().convertTypeTo(t.attList[r].type,!0)+">":"List<"+t.attList[r].type.charAt(0).toLocaleUpperCase()+t.attList[r].type.slice(1)+">",this._code+=this.getDocHelper().getIndent(1)+"public "+e+" "+t.attList[r].name+" = new ArrayList<"+(this.getTypeConvertor().hasType(t.attList[r].type)?this.getTypeConvertor().convertTypeTo(t.attList[r].type,!0):t.attList[r].type.charAt(0).toLocaleUpperCase()+t.attList[r].type.slice(1))+">();\n"):(e=this.getTypeConvertor().hasType(t.attList[r].type)?this.getTypeConvertor().convertTypeTo(t.attList[r].type):t.attList[r].type.charAt(0).toLocaleUpperCase()+t.attList[r].type.slice(1),this._code+=this.getDocHelper().getIndent(1)+"public "+e+" "+t.attList[r].name,o=this.getTypeConvertor().hasType(t.attList[r].type)?this.getTypeConvertor().getDefaultValue(e):"",this._code+=o?" = "+o+";\n":" = new "+e+"();\n");this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"public static final "+this._name+" fromBytes(byte[] bytes) {\n",this._code+=this.getDocHelper().getIndent(2)+"ByteArray byteArray = new ByteArray(bytes);\n",this._code+=this.getDocHelper().getIndent(2)+"byteArray.setPosition(0);\n",this._code+=this.getDocHelper().getIndent(2)+this._name+" info = new "+this._name+"();\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = (BuffObject) BuffBytesUtil.fromBytes(byteArray);\n",this._code+=this.getDocHelper().getIndent(2)+"byteArray.clear();\n",this._code+=this.getDocHelper().getIndent(2)+"List<IBuffInfo> atts = buff.getAttributes();\n";for(var n=0;n<t.attList.length;n++)this._code+=this.getDocHelper().getIndent(2)+"if ("+n+" < atts.size())\n",e=this.getTypeConvertor().hasType(t.attList[n].type)?t.attList[n].type:t.attList[n].type.charAt(0).toLocaleLowerCase()+t.attList[n].type.slice(1),t.attList[n].isList?this._code+=this.getDocHelper().getIndent(3)+"info."+t.attList[n].name+" = BuffListConverter.getInstance()."+e+'ListFromBuff("'+t.attList[n].name+'", atts.get('+n+"));\n":this._code+=this.getDocHelper().getIndent(3)+"info."+t.attList[n].name+" = BuffConverter.getInstance()."+e+'FromBuff("'+t.attList[n].name+'", atts.get('+n+"));\n";for(this._code+=this.getDocHelper().getIndent(2)+"return info;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="\n",this._code+=this.getDocHelper().getIndent(1)+"public static final byte[] toBytes("+this._name+" info) {\n",this._code+=this.getDocHelper().getIndent(2)+"BuffObject buff = new BuffObject();\n",n=0;n<t.attList.length;n++)e=this.getTypeConvertor().hasType(t.attList[n].type)?t.attList[n].type:t.attList[n].type.charAt(0).toLocaleLowerCase()+t.attList[n].type.slice(1),t.attList[n].isList?this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffListConverter.getInstance()."+e+"ListToBuff(info."+t.attList[n].name+', "'+t.attList[n].name+'"));\n':this._code+=this.getDocHelper().getIndent(2)+"buff.addAttribute(BuffConverter.getInstance()."+e+"ToBuff(info."+t.attList[n].name+', "'+t.attList[n].name+'"));\n';this._code+=this.getDocHelper().getIndent(2)+"ByteArray byteArray = BuffBytesUtil.toBytes(buff);\n",this._code+=this.getDocHelper().getIndent(2)+"byte[] bytes = byteArray.getBytes();\n",this._code+=this.getDocHelper().getIndent(2)+"byteArray.clear();\n",this._code+=this.getDocHelper().getIndent(2)+"return bytes;\n",this._code+=this.getDocHelper().getIndent(1)+"}\n",this._code+="}\n"},s.prototype.checkHasByteArray=function(t){for(var e=0;e<t.attList.length;e++)if(t.attList[e].isList){if(this.getTypeConvertor().hasType(t.attList[e].type)&&"ByteArray"==this.getTypeConvertor().convertTypeTo(t.attList[e].type,!0))return!0}else if(this.getTypeConvertor().hasType(t.attList[e].type)&&"ByteArray"==this.getTypeConvertor().convertTypeTo(t.attList[e].type))return!0;return!1},s.prototype.checkHasList=function(t){for(var e=0;e<t.attList.length;e++)if(t.attList[e].isList)return!0;return!1},o=s,e.JavaVOGenerator=o},275:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.syntaxAnalyzer=void 0;var r=o(160);function n(){this.currentWord="",this.loc=0,this.isNote=!1,this.rowId=0}n.prototype.analyse=function(t,e){this.str=t,this.loc=0,this.currentWord="",this.words=[],this.rowId=0,this.syntaxTree=e,this.nextChar()},n.prototype.nextChar=function(){for(;;){if(this.loc>=this.str.length){this.anslyseWorlds();break}this.loc<this.str.length-2&&"/"==this.str.charAt(this.loc+1)&&"/"==this.str.charAt(this.loc)&&(this.isNote=!0),this.isNote?"\n"!=this.str.charAt(this.loc)&&"\r"!=this.str.charAt(this.loc)?this.currentWord+=this.str.charAt(this.loc):(this.isNote=!1,0<this.currentWord.length&&this.words.push({row:this.rowId,word:this.currentWord}),this.rowId++,this.currentWord=""):"{"==this.str.charAt(this.loc)||"}"==this.str.charAt(this.loc)?(0<this.currentWord.length&&(this.words.push({row:this.rowId,word:this.currentWord}),this.currentWord=""),this.currentWord+=this.str.charAt(this.loc),this.words.push({row:this.rowId,word:this.currentWord}),this.currentWord=""):"\n"!=this.str.charAt(this.loc)&&"\r"!=this.str.charAt(this.loc)&&" "!=this.str.charAt(this.loc)&&";"!=this.str.charAt(this.loc)&&"\t"!=this.str.charAt(this.loc)?this.currentWord+=this.str.charAt(this.loc):(0<this.currentWord.length&&this.words.push({row:this.rowId,word:this.currentWord}),"\n"!=this.str.charAt(this.loc)&&"\r"!=this.str.charAt(this.loc)||this.rowId++,this.currentWord=""),this.loc==this.str.length-1&&(0<this.currentWord.length&&this.words.push({row:this.rowId,word:this.currentWord}),this.currentWord=""),this.loc++}},n.prototype.anslyseWorlds=function(){if(0!=this.words.length){for(var t,e=0;e<this.words.length;e++)0==this.words[e].word.indexOf("//")&&-1==this.words[e].word.indexOf("///")&&(this.words.splice(e,1),e--);for(e=0;e<this.words.length-1;e++)0==this.words[e].word.indexOf("///")&&0==this.words[e+1].word.indexOf("///")&&(this.words[e].word=this.words[e].word+this.words[e+1].word.slice(3),e--);for(e=0;e<this.words.length;e++)"}"==this.words[e].word&&(t=this.words.slice(0,e+1),this.words=this.words.slice(e+1),(1<=t.length&&"vo"==t[0].word||2<=t.length&&"vo"==t[1].word)&&(t=new r.BeanTokenizer(t),this.syntaxTree.beans.push(t.getResult())),this.anslyseWorlds())}},o=n,e.syntaxAnalyzer=new o},300:(t,e)=>{"use strict";function o(){this.type="",this.name="",this.note="",this.isList=!1}Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeNode=void 0,o.prototype.toString=function(){return"[type:"+this.type+", name:"+this.name+", note:"+this.note+", isList:"+this.isList+"]"},e.AttributeNode=o},288:(t,e)=>{"use strict";function o(){this.name="",this.note=""}Object.defineProperty(e,"__esModule",{value:!0}),e.BeanNode=void 0,o.prototype.toString=function(){for(var t="Bean:"+this.name+", note:"+this.note+"\n",e=0;e<this.attList.length;e++)t+="\t"+this.attList[e]+"\n";return t},e.BeanNode=o},691:(t,e)=>{"use strict";function o(){this.beans=[]}Object.defineProperty(e,"__esModule",{value:!0}),e.SyntaxNodeTree=void 0,o.prototype.toString=function(){for(var t="",e=0;e<this.beans.length;e++)t+=this.beans[e];return t},e.SyntaxNodeTree=o},483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.configTemplate=e.protoTemplate=void 0,e.protoTemplate="/// Example information description\nvo ExampleInfo\n{\t\n\tbyte byteProp;\t\t\t\t/// Property of byte format. A 8-bit signed integer between -128 and 127.\n\tshort shortProp;\t\t\t/// Property of short format. A 16-bit signed integer between -32768 and 32767.\n\tint intProp;\t\t\t\t/// Property of int format. A 32-bit signed integer between -2147483648 and 2147483647.\n\tint64 int64Prop;\t\t\t/// Property of int format. A 64-bit signed integer between -9223372036854775808 and 9223372036854775807.\n\tubyte ubyteProp;\t\t\t/// Property of byte format. A 8-bit unsigned integer between 0 and 255.\n\tushort ushortProp;\t\t\t/// Property of short format. A 16-bit unsigned integer between 0 and 65535.\n\tuint uintProp;\t\t\t\t/// Property of int format. A 32-bit unsigned integer between 0 and 4294967295.\n\tfloat floatProp;\t\t\t/// Property of float format. A single-precision (32-bit) floating-point number.\n\tdouble doubleProp;\t\t\t/// Property of double format. A double-precision (64-bit) floating-point number.\n\tbool boolProp;\t\t\t\t/// Property of bool format. An 8-bit signed integer\n\tstring stringProp;\t\t\t/// Property of string format. A UTF-8 string from the byte stream. The string is assumed to be prefixed with an short indicating the length in bytes.\n\tlongstring longstringProp;\t/// Property of longstring format. A UTF-8 string from the byte stream. The string is assumed to be prefixed with an int indicating the length in bytes.\n\tbytes bytesProp;\t\t\t/// Property of bytes format. An 8-bit signed integer\n\t\n\tAttInfo att1Prop;\t\t\t/// Property of AttInfo.\n\tAttInfo att2Prop;\t\t\t/// Property of AttInfo.\n\n\tList<byte> byteListProp;\t\t\t\t/// Byte list property.\n\tList<short> shortListProp;\t\t\t\t/// Short list property.\n\tList<int> intListProp;\t\t\t\t\t/// Int list property.\n\tList<ubyte> ubyteListProp;\t\t\t\t/// Ubyte list property.\n\tList<ushort> ushortListProp;\t\t\t/// Ushort list property.\n\tList<uint> uintListProp;\t\t\t\t/// Uint list property.\n\tList<int64> int64ListProp;\t\t\t\t/// Int64 list property.\n\tList<float> floatListProp;\t\t\t\t/// Float list property.\n\tList<double> doubleListProp;\t\t\t/// Double list property.\n\tList<bool> boolListProp;\t\t\t\t/// Bool list property.\n\tList<string> stringListProp;\t\t\t/// String list property.\n\tList<longstring> longstringListProp;\t/// Longstring list property.\n\tList<bytes> bytesListProp;\t\t\t\t/// Bytes list property.\n\n\tList<AttInfo> attInfo1ListProp;\t\t\t/// AttInfo list property.\n\tList<AttInfo> attInfo2ListProp;\t\t\t/// AttInfo list property.\n}\n\n/// An Attribute Info example\nvo AttInfo{\n\tshort attId;\t\t\t/// Property of short format. A 16-bit signed integer between -32768 and 32767.\n\tstring attName;\t\t\t/// Property of string format. A UTF-8 string from the byte stream. The string is assumed to be prefixed with an short indicating the length in bytes.\n\tstring attDesc;\t\t\t/// Property of string format. A UTF-8 string from the byte stream. The string is assumed to be prefixed with an short indicating the length in bytes.\n\tint attValue;\t\t\t/// Property of int format. A 32-bit signed integer between -2147483648 and 2147483647.\n}",e.configTemplate=JSON.stringify({sourceDir:"./",outputs:[{type:"java",dir:"./my-generate/java/com/myprotos",package:"com.myprotos",author:"MyName",clear:!1},{type:"dart",dir:"./my-generate/dart/com/myprotos",package:"com/myprotos",author:"MyName",clear:!1}]},null,"\t")},434:function(t,e){"use strict";var o,r,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=(Object.defineProperty(e,"__esModule",{value:!0}),e.getDocHelper=e.DocType=void 0,(i=r=e.DocType||(e.DocType={})).JAVA_DOC="javaDoc",i.DART_DOC="dartDoc",s.prototype.getClassDoc=function(t,e,o,r){return void 0===e&&(e=1),void 0===o&&(o=null),void 0===r&&(r=!1),""},s.prototype.getFuncDoc=function(t,e,o,r){return void 0===e&&(e=1),void 0===o&&(o=null),void 0===r&&(r=null),""},s.prototype.getAttrDoc=function(t,e){return void 0===e&&(e=1),""},s.prototype.getImport=function(t,e){return void 0===e&&(e=1),""},s.prototype.getIndent=function(t){void 0===t&&(t=1);for(var e="",o=0;o<t;o++)e+="\t";return e},s);function s(){}n(l,a=i),l.prototype.getClassDoc=function(t,e,o,r){void 0===o&&(o=null),void 0===r&&(r=!1);var n=(n=(n="")+this.getIndent(e=void 0===e?1:e)+"/**\n")+this.getIndent(e)+" * "+t+"\n";return o&&(n=(n=n+this.getIndent(e)+" * \n")+this.getIndent(e)+" * @author "+o+"\n"),(n=r?(n=n+this.getIndent(e)+" * \n")+this.getIndent(e)+" * @internal\n":n)+this.getIndent(e)+" */\n"},l.prototype.getFuncDoc=function(t,e,o,r){if(void 0===o&&(o=null),void 0===r&&(r=null),n=(n=(n="")+this.getIndent(e=void 0===e?1:e)+"/**\n")+this.getIndent(e)+" * "+t+"\n",o&&0<o.length)for(var n=n+this.getIndent(e)+" * \n",i=0;i<o.length;i++)n=(n+=this.getIndent(e))+" * @param "+o[i].name+" "+o[i].notes+"\n";return(n=r?n+this.getIndent(e)+" * @return "+r+"\n":n)+this.getIndent(e)+" */\n"},l.prototype.getAttrDoc=function(t,e){return this.getFuncDoc(t,e=void 0===e?1:e)},l.prototype.getImport=function(t,e){void 0===e&&(e=1);for(var o="",r=0;r<t.length;r++)o=(o+=this.getIndent(e))+"import "+t[r]+";\n";return o};var a,c,h=l;function l(){return null!==a&&a.apply(this,arguments)||this}function p(){return null!==c&&c.apply(this,arguments)||this}n(p,c=i),p.prototype.getClassDoc=function(t,e,o,r){return void 0===o&&(o=null),void 0===r&&(r=!1),(o="")+this.getIndent(e=void 0===e?1:e)+"/// "+t+"\n"},p.prototype.getFuncDoc=function(t,e,o,r){return void 0===o&&(o=null),void 0===r&&(r=null),(o="")+this.getIndent(e=void 0===e?1:e)+"/// "+t+"\n"},p.prototype.getAttrDoc=function(t,e){return this.getFuncDoc(t,e=void 0===e?1:e)},p.prototype.getImport=function(t,e){void 0===e&&(e=1);for(var o="",r=0;r<t.length;r++)o=(o+=this.getIndent(e))+"import 'package:"+t[r]+"';\n";return o},n=p;var u={};u[r.JAVA_DOC]=new h,u[r.DART_DOC]=new n,e.getDocHelper=function(t){return u[t]}},787:(t,e)=>{"use strict";function o(t,e){for(var o=t.split(/([A-Z][a-z]{1,})|([0-9]{1,})/g),r=[],n=0;n<o.length;n++)if(o[n])for(var i=o[n].split("_"),s=0;s<i.length;s++)""!=i[s]&&(e?r.push(String(i[s]).toLocaleUpperCase()):r.push(String(i[s]).toLocaleLowerCase()));return r.join("_")}Object.defineProperty(e,"__esModule",{value:!0}),e.getConstLowerStr=e.getConstUpperStr=void 0,e.getConstUpperStr=function(t){return o(t,!0)},e.getConstLowerStr=function(t){return o(t,!1)}},3:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeDir=e.writeFile=e.readFile=e.search=void 0;var r=o(147),n=o(17);e.search=function(t,e){e=(e=void 0===e?null:e)&&(e="."!=e.charAt(0)?"."+e:e).toLocaleLowerCase();var o=[];return function t(e,i){r.readdirSync(e).forEach((function(s){s=n.join(e,s);var a=r.statSync(s);a.isDirectory()?t(s,i):a.isFile()&&(a=n.extname(s),i&&a.toLocaleLowerCase()!=i||o.push(s))}))}(t,e),o},e.readFile=function(t){return r.readFileSync(t,"utf-8")},e.writeFile=function(t,e,o){var i="",s=null==(o=void 0===o?null:o)?(i=t,e):(i=n.join(t,e),o);!function t(e){return r.existsSync(e)||t(n.dirname(e))&&(r.mkdirSync(e),1)}(n.dirname(i)),r.writeFileSync(i,s)},e.removeDir=function t(e){r.existsSync(e)&&(r.readdirSync(e).forEach((function(o){o=n.join(e,o),r.statSync(o).isDirectory()?t(o):r.unlinkSync(o)})),r.rmdirSync(e))}},939:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTypeConvertor=e.TypeConvertor=void 0,o=o(633);var r=(n.prototype.convertTypeTo=function(t,e){return((e=void 0!==e&&e)?this.typeInListMap:this.typeMap)[t]},n.prototype.getDefaultValue=function(t){return this.defaultValueMap[t]},n.prototype.hasType=function(t){return t in this.typeMap},n);function n(t,e,o){this.typeMap=t,this.typeInListMap=e,this.defaultValueMap=o}e.TypeConvertor=r;var i={};i[o.LanguageType.JAVA]=new r({byte:"int",short:"int",int:"int",ubyte:"int",ushort:"int",uint:"long",int64:"long",float:"double",double:"double",bool:"boolean",string:"String",longstring:"String",bytes:"ByteArray"},{byte:"Integer",short:"Integer",int:"Integer",ubyte:"Integer",ushort:"Integer",uint:"Long",int64:"Long",float:"Double",double:"Double",bool:"Boolean",string:"String",longstring:"String",bytes:"ByteArray"},{int:"0",long:"0l",double:"0",boolean:"false",String:'""',ByteArray:"new ByteArray()"}),i[o.LanguageType.DART]=new r({byte:"int",short:"int",int:"int",ubyte:"int",ushort:"int",uint:"int",int64:"int",float:"double",double:"double",bool:"bool",string