ProtoBuf.DotProto.Tokenizer.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Tokenizer</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: Tokenizer</h1>
  17. <section>
  18. <header>
  19. <h2>
  20. <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
  21. Tokenizer
  22. </h2>
  23. <div class="class-description"><p>prototype tokenizer</p></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h4 class="name" id="Tokenizer"><span class="type-signature"></span>new Tokenizer<span class="signature">(proto)</span><span class="type-signature"></span></h4>
  29. <div class="description">
  30. <p>Constructs a new Tokenizer.</p>
  31. </div>
  32. <h5>Parameters:</h5>
  33. <table class="params">
  34. <thead>
  35. <tr>
  36. <th>Name</th>
  37. <th>Type</th>
  38. <th class="last">Description</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr>
  43. <td class="name"><code>proto</code></td>
  44. <td class="type">
  45. <span class="param-type">string</span>
  46. </td>
  47. <td class="description last"><p>Proto to tokenize</p></td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. <dl class="details">
  52. <dt class="tag-source">Source:</dt>
  53. <dd class="tag-source"><ul class="dummy"><li>
  54. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line495">line 495</a>
  55. </li></ul></dd>
  56. </dl>
  57. </div>
  58. <h3 class="subsection-title">Members</h3>
  59. <h4 class="name" id="index"><span class="type-signature"></span>index<span class="type-signature"> :number</span></h4>
  60. <div class="description">
  61. <p>Current index.</p>
  62. </div>
  63. <h5>Type:</h5>
  64. <ul>
  65. <li>
  66. <span class="param-type">number</span>
  67. </li>
  68. </ul>
  69. <dl class="details">
  70. <dt class="tag-source">Source:</dt>
  71. <dd class="tag-source"><ul class="dummy"><li>
  72. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line509">line 509</a>
  73. </li></ul></dd>
  74. </dl>
  75. <h4 class="name" id="line"><span class="type-signature"></span>line<span class="type-signature"> :number</span></h4>
  76. <div class="description">
  77. <p>Current line.</p>
  78. </div>
  79. <h5>Type:</h5>
  80. <ul>
  81. <li>
  82. <span class="param-type">number</span>
  83. </li>
  84. </ul>
  85. <dl class="details">
  86. <dt class="tag-source">Source:</dt>
  87. <dd class="tag-source"><ul class="dummy"><li>
  88. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line516">line 516</a>
  89. </li></ul></dd>
  90. </dl>
  91. <h4 class="name" id="source"><span class="type-signature"></span>source<span class="type-signature"> :string</span></h4>
  92. <div class="description">
  93. <p>Source to parse.</p>
  94. </div>
  95. <h5>Type:</h5>
  96. <ul>
  97. <li>
  98. <span class="param-type">string</span>
  99. </li>
  100. </ul>
  101. <dl class="details">
  102. <dt class="tag-source">Source:</dt>
  103. <dd class="tag-source"><ul class="dummy"><li>
  104. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line502">line 502</a>
  105. </li></ul></dd>
  106. </dl>
  107. <h4 class="name" id="stack"><span class="type-signature">(non-null) </span>stack<span class="type-signature"> :Array.&lt;string></span></h4>
  108. <div class="description">
  109. <p>Token stack.</p>
  110. </div>
  111. <h5>Type:</h5>
  112. <ul>
  113. <li>
  114. <span class="param-type">Array.&lt;string></span>
  115. </li>
  116. </ul>
  117. <dl class="details">
  118. <dt class="tag-source">Source:</dt>
  119. <dd class="tag-source"><ul class="dummy"><li>
  120. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line523">line 523</a>
  121. </li></ul></dd>
  122. </dl>
  123. <h3 class="subsection-title">Methods</h3>
  124. <h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
  125. <div class="description">
  126. <p>Gets the next token and advances by one.</p>
  127. </div>
  128. <dl class="details">
  129. <dt class="tag-source">Source:</dt>
  130. <dd class="tag-source"><ul class="dummy"><li>
  131. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line563">line 563</a>
  132. </li></ul></dd>
  133. </dl>
  134. <h5>Returns:</h5>
  135. <div class="param-desc">
  136. <p>Token or <code>null</code> on EOF</p>
  137. </div>
  138. <dl>
  139. <dt>
  140. Type
  141. </dt>
  142. <dd>
  143. <span class="param-type">string</span>
  144. </dd>
  145. </dl>
  146. <h4 class="name" id="omit"><span class="type-signature"></span>omit<span class="signature">(expected)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
  147. <div class="description">
  148. <p>Omits an optional token.</p>
  149. </div>
  150. <h5>Parameters:</h5>
  151. <table class="params">
  152. <thead>
  153. <tr>
  154. <th>Name</th>
  155. <th>Type</th>
  156. <th class="last">Description</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <tr>
  161. <td class="name"><code>expected</code></td>
  162. <td class="type">
  163. <span class="param-type">string</span>
  164. </td>
  165. <td class="description last"><p>Expected optional token</p></td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <dl class="details">
  170. <dt class="tag-source">Source:</dt>
  171. <dd class="tag-source"><ul class="dummy"><li>
  172. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line658">line 658</a>
  173. </li></ul></dd>
  174. </dl>
  175. <h5>Returns:</h5>
  176. <div class="param-desc">
  177. <p><code>true</code> if the token exists</p>
  178. </div>
  179. <dl>
  180. <dt>
  181. Type
  182. </dt>
  183. <dd>
  184. <span class="param-type">boolean</span>
  185. </dd>
  186. </dl>
  187. <h4 class="name" id="peek"><span class="type-signature"></span>peek<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
  188. <div class="description">
  189. <p>Peeks for the next token.</p>
  190. </div>
  191. <dl class="details">
  192. <dt class="tag-source">Source:</dt>
  193. <dd class="tag-source"><ul class="dummy"><li>
  194. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line632">line 632</a>
  195. </li></ul></dd>
  196. </dl>
  197. <h5>Returns:</h5>
  198. <div class="param-desc">
  199. <p>Token or <code>null</code> on EOF</p>
  200. </div>
  201. <dl>
  202. <dt>
  203. Type
  204. </dt>
  205. <dd>
  206. <span class="param-type">string</span>
  207. </dd>
  208. </dl>
  209. <h4 class="name" id="skip"><span class="type-signature"></span>skip<span class="signature">(expected)</span><span class="type-signature"></span></h4>
  210. <div class="description">
  211. <p>Skips a specific token and throws if it differs.</p>
  212. </div>
  213. <h5>Parameters:</h5>
  214. <table class="params">
  215. <thead>
  216. <tr>
  217. <th>Name</th>
  218. <th>Type</th>
  219. <th class="last">Description</th>
  220. </tr>
  221. </thead>
  222. <tbody>
  223. <tr>
  224. <td class="name"><code>expected</code></td>
  225. <td class="type">
  226. <span class="param-type">string</span>
  227. </td>
  228. <td class="description last"><p>Expected token</p></td>
  229. </tr>
  230. </tbody>
  231. </table>
  232. <dl class="details">
  233. <dt class="tag-source">Source:</dt>
  234. <dd class="tag-source"><ul class="dummy"><li>
  235. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line647">line 647</a>
  236. </li></ul></dd>
  237. </dl>
  238. <h5>Throws:</h5>
  239. <dl>
  240. <dt>
  241. <div class="param-desc">
  242. <p>If the actual token differs</p>
  243. </div>
  244. </dt>
  245. <dd></dd>
  246. <dt>
  247. <dl>
  248. <dt>
  249. Type
  250. </dt>
  251. <dd>
  252. <span class="param-type">Error</span>
  253. </dd>
  254. </dl>
  255. </dt>
  256. <dd></dd>
  257. </dl>
  258. <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
  259. <div class="description">
  260. <p>Returns a string representation of this object.</p>
  261. </div>
  262. <dl class="details">
  263. <dt class="tag-source">Source:</dt>
  264. <dd class="tag-source"><ul class="dummy"><li>
  265. <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line671">line 671</a>
  266. </li></ul></dd>
  267. </dl>
  268. <h5>Returns:</h5>
  269. <div class="param-desc">
  270. <p>String representation as of &quot;Tokenizer(index/length)&quot;</p>
  271. </div>
  272. <dl>
  273. <dt>
  274. Type
  275. </dt>
  276. <dd>
  277. <span class="param-type">string</span>
  278. </dd>
  279. </dl>
  280. </article>
  281. </section>
  282. </div>
  283. <nav>
  284. <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
  285. </nav>
  286. <br class="clear">
  287. <footer>
  288. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
  289. </footer>
  290. <script> prettyPrint(); </script>
  291. <script src="scripts/linenumber.js"> </script>
  292. </body>
  293. </html>