term_utils 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/COPYING +3 -3
  4. data/README.md +7 -1
  5. data/doc/TermUtils/AP/Article.html +991 -0
  6. data/doc/TermUtils/AP/Element.html +1025 -0
  7. data/doc/TermUtils/AP/Flag.html +539 -0
  8. data/doc/TermUtils/AP/Level.html +638 -0
  9. data/doc/TermUtils/AP/NoSuchValueError.html +217 -0
  10. data/doc/TermUtils/AP/Parameter.html +804 -0
  11. data/doc/TermUtils/AP/ParseError.html +217 -0
  12. data/doc/TermUtils/AP/Parser.html +572 -0
  13. data/doc/TermUtils/AP/Result.html +1029 -0
  14. data/doc/TermUtils/AP/ResultView.html +597 -0
  15. data/doc/TermUtils/AP/Syntax.html +1051 -0
  16. data/doc/TermUtils/AP/SyntaxError.html +217 -0
  17. data/doc/TermUtils/AP.html +505 -0
  18. data/doc/TermUtils/FF/Config.html +1 -1
  19. data/doc/TermUtils/FF/Cursor/Context.html +1 -1
  20. data/doc/TermUtils/FF/Cursor.html +1 -1
  21. data/doc/TermUtils/FF/Query.html +1 -1
  22. data/doc/TermUtils/FF.html +1 -1
  23. data/doc/TermUtils/PropertyTreeNode.html +1999 -0
  24. data/doc/TermUtils/Tab/Column.html +1 -1
  25. data/doc/TermUtils/Tab/Holder.html +1 -1
  26. data/doc/TermUtils/Tab/Printer.html +1 -1
  27. data/doc/TermUtils/Tab/Table.html +1 -1
  28. data/doc/TermUtils/Tab.html +1 -1
  29. data/doc/TermUtils.html +5 -3
  30. data/doc/_index.html +143 -1
  31. data/doc/class_list.html +1 -1
  32. data/doc/file.README.html +8 -2
  33. data/doc/index.html +8 -2
  34. data/doc/method_list.html +638 -22
  35. data/doc/top-level-namespace.html +1 -1
  36. data/lib/term_utils/ap/article.rb +68 -0
  37. data/lib/term_utils/ap/element.rb +78 -0
  38. data/lib/term_utils/ap/flag.rb +48 -0
  39. data/lib/term_utils/ap/level.rb +57 -0
  40. data/lib/term_utils/ap/no_such_value_error.rb +27 -0
  41. data/lib/term_utils/ap/parameter.rb +75 -0
  42. data/lib/term_utils/ap/parse_error.rb +27 -0
  43. data/lib/term_utils/ap/parser.rb +185 -0
  44. data/lib/term_utils/ap/result.rb +175 -0
  45. data/lib/term_utils/ap/syntax.rb +112 -0
  46. data/lib/term_utils/ap/syntax_error.rb +27 -0
  47. data/lib/term_utils/ap.rb +59 -0
  48. data/lib/term_utils/property_tree_node.rb +200 -0
  49. data/lib/term_utils.rb +1 -0
  50. data/term_utils.gemspec +2 -2
  51. metadata +29 -2
@@ -0,0 +1,572 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: TermUtils::AP::Parser
8
+
9
+ &mdash; Documentation by YARD 0.9.20
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "TermUtils::AP::Parser";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (P)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../AP.html" title="TermUtils::AP (module)">AP</a></span></span>
41
+ &raquo;
42
+ <span class="title">Parser</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: TermUtils::AP::Parser
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">TermUtils::AP::Parser</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/term_utils/ap/parser.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Represents the argument list parser.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <h2>
122
+ Instance Method Summary
123
+ <small><a href="#" class="summary_toggle">collapse</a></small>
124
+ </h2>
125
+
126
+ <ul class="summary">
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; Parser </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+ <span class="note title constructor">constructor</span>
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>A new instance of Parser.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#parse_arguments-instance_method" title="#parse_arguments (instance method)">#<strong>parse_arguments</strong>(syntax, arguments, opts = {}) &#x21d2; TermUtils::AP::Result </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Parses a given list of arguments.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#parse_command-instance_method" title="#parse_command (instance method)">#<strong>parse_command</strong>(syntax, command, opts = {}) &#x21d2; TermUtils::AP::Result </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'>
196
+ <p>Parses a given command.</p>
197
+ </div></span>
198
+
199
+ </li>
200
+
201
+
202
+ </ul>
203
+
204
+
205
+ <div id="constructor_details" class="method_details_list">
206
+ <h2>Constructor Details</h2>
207
+
208
+ <div class="method_details first">
209
+ <h3 class="signature first" id="initialize-instance_method">
210
+
211
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="TermUtils::AP::Parser (class)">Parser</a></span></tt>
212
+
213
+
214
+
215
+
216
+
217
+ </h3><div class="docstring">
218
+ <div class="discussion">
219
+
220
+ <p>Returns a new instance of Parser</p>
221
+
222
+
223
+ </div>
224
+ </div>
225
+ <div class="tags">
226
+
227
+
228
+ </div><table class="source_code">
229
+ <tr>
230
+ <td>
231
+ <pre class="lines">
232
+
233
+
234
+ 22
235
+ 23</pre>
236
+ </td>
237
+ <td>
238
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ap/parser.rb', line 22</span>
239
+
240
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
241
+ <span class='kw'>end</span></pre>
242
+ </td>
243
+ </tr>
244
+ </table>
245
+ </div>
246
+
247
+ </div>
248
+
249
+
250
+ <div id="instance_method_details" class="method_details_list">
251
+ <h2>Instance Method Details</h2>
252
+
253
+
254
+ <div class="method_details first">
255
+ <h3 class="signature first" id="parse_arguments-instance_method">
256
+
257
+ #<strong>parse_arguments</strong>(syntax, arguments, opts = {}) &#x21d2; <tt><span class='object_link'><a href="Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>
258
+
259
+
260
+
261
+
262
+
263
+ </h3><div class="docstring">
264
+ <div class="discussion">
265
+
266
+ <p>Parses a given list of arguments.</p>
267
+
268
+
269
+ </div>
270
+ </div>
271
+ <div class="tags">
272
+ <p class="tag_title">Parameters:</p>
273
+ <ul class="param">
274
+
275
+ <li>
276
+
277
+ <span class='name'>syntax</span>
278
+
279
+
280
+ <span class='type'>(<tt><span class='object_link'><a href="Syntax.html" title="TermUtils::AP::Syntax (class)">TermUtils::AP::Syntax</a></span></tt>)</span>
281
+
282
+
283
+
284
+ </li>
285
+
286
+ <li>
287
+
288
+ <span class='name'>arguments</span>
289
+
290
+
291
+ <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
292
+
293
+
294
+
295
+ </li>
296
+
297
+ <li>
298
+
299
+ <span class='name'>opts</span>
300
+
301
+
302
+ <span class='type'>(<tt>Hash</tt>)</span>
303
+
304
+
305
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
306
+
307
+
308
+ &mdash;
309
+ <div class='inline'>
310
+ <p>`:program`.</p>
311
+ </div>
312
+
313
+ </li>
314
+
315
+ </ul>
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+ <p class="tag_title">Options Hash (<tt>opts</tt>):</p>
325
+ <ul class="option">
326
+
327
+ <li>
328
+ <span class="name">:program</span>
329
+ <span class="type">(<tt>Boolean</tt>)</span>
330
+ <span class="default">
331
+
332
+ </span>
333
+
334
+ &mdash; <div class='inline'>
335
+ <p>Whether the first argument is the program name.</p>
336
+ </div>
337
+
338
+ </li>
339
+
340
+ </ul>
341
+
342
+
343
+ <p class="tag_title">Returns:</p>
344
+ <ul class="return">
345
+
346
+ <li>
347
+
348
+
349
+ <span class='type'>(<tt><span class='object_link'><a href="Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>)</span>
350
+
351
+
352
+
353
+ </li>
354
+
355
+ </ul>
356
+ <p class="tag_title">Raises:</p>
357
+ <ul class="raise">
358
+
359
+ <li>
360
+
361
+
362
+ <span class='type'>(<tt><span class='object_link'><a href="ParseError.html" title="TermUtils::AP::ParseError (class)">TermUtils::AP::ParseError</a></span></tt>)</span>
363
+
364
+
365
+
366
+ </li>
367
+
368
+ <li>
369
+
370
+
371
+ <span class='type'>(<tt><span class='object_link'><a href="SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">TermUtils::AP::SyntaxError</a></span></tt>)</span>
372
+
373
+
374
+
375
+ </li>
376
+
377
+ </ul>
378
+
379
+ </div><table class="source_code">
380
+ <tr>
381
+ <td>
382
+ <pre class="lines">
383
+
384
+
385
+ 43
386
+ 44
387
+ 45
388
+ 46
389
+ 47
390
+ 48
391
+ 49
392
+ 50
393
+ 51
394
+ 52</pre>
395
+ </td>
396
+ <td>
397
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ap/parser.rb', line 43</span>
398
+
399
+ <span class='kw'>def</span> <span class='id identifier rubyid_parse_arguments'>parse_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
400
+ <span class='id identifier rubyid_syntax'>syntax</span> <span class='op'>=</span> <span class='id identifier rubyid_syntax'>syntax</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
401
+ <span class='id identifier rubyid_syntax'>syntax</span><span class='period'>.</span><span class='id identifier rubyid_finalize!'>finalize!</span>
402
+ <span class='id identifier rubyid_arguments'>arguments</span> <span class='op'>=</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
403
+ <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../AP.html" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result.html" title="TermUtils::AP::Result (class)">Result</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result.html#initialize-instance_method" title="TermUtils::AP::Result#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='rparen'>)</span>
404
+ <span class='id identifier rubyid_catch'>catch</span> <span class='symbol'>:done</span> <span class='kw'>do</span>
405
+ <span class='id identifier rubyid_parse0'>parse0</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
406
+ <span class='kw'>end</span>
407
+ <span class='id identifier rubyid_res'>res</span>
408
+ <span class='kw'>end</span></pre>
409
+ </td>
410
+ </tr>
411
+ </table>
412
+ </div>
413
+
414
+ <div class="method_details ">
415
+ <h3 class="signature " id="parse_command-instance_method">
416
+
417
+ #<strong>parse_command</strong>(syntax, command, opts = {}) &#x21d2; <tt><span class='object_link'><a href="Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>
418
+
419
+
420
+
421
+
422
+
423
+ </h3><div class="docstring">
424
+ <div class="discussion">
425
+
426
+ <p>Parses a given command.</p>
427
+
428
+
429
+ </div>
430
+ </div>
431
+ <div class="tags">
432
+ <p class="tag_title">Parameters:</p>
433
+ <ul class="param">
434
+
435
+ <li>
436
+
437
+ <span class='name'>syntax</span>
438
+
439
+
440
+ <span class='type'>(<tt><span class='object_link'><a href="Syntax.html" title="TermUtils::AP::Syntax (class)">TermUtils::AP::Syntax</a></span></tt>)</span>
441
+
442
+
443
+
444
+ </li>
445
+
446
+ <li>
447
+
448
+ <span class='name'>command</span>
449
+
450
+
451
+ <span class='type'>(<tt>String</tt>)</span>
452
+
453
+
454
+
455
+ </li>
456
+
457
+ <li>
458
+
459
+ <span class='name'>opts</span>
460
+
461
+
462
+ <span class='type'>(<tt>Hash</tt>)</span>
463
+
464
+
465
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
466
+
467
+
468
+ &mdash;
469
+ <div class='inline'>
470
+ <p>`:program`.</p>
471
+ </div>
472
+
473
+ </li>
474
+
475
+ </ul>
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+ <p class="tag_title">Options Hash (<tt>opts</tt>):</p>
485
+ <ul class="option">
486
+
487
+ <li>
488
+ <span class="name">:program</span>
489
+ <span class="type">(<tt>Boolean</tt>)</span>
490
+ <span class="default">
491
+
492
+ </span>
493
+
494
+ &mdash; <div class='inline'>
495
+ <p>Whether the first argument is the program name.</p>
496
+ </div>
497
+
498
+ </li>
499
+
500
+ </ul>
501
+
502
+
503
+ <p class="tag_title">Returns:</p>
504
+ <ul class="return">
505
+
506
+ <li>
507
+
508
+
509
+ <span class='type'>(<tt><span class='object_link'><a href="Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>)</span>
510
+
511
+
512
+
513
+ </li>
514
+
515
+ </ul>
516
+ <p class="tag_title">Raises:</p>
517
+ <ul class="raise">
518
+
519
+ <li>
520
+
521
+
522
+ <span class='type'>(<tt><span class='object_link'><a href="ParseError.html" title="TermUtils::AP::ParseError (class)">TermUtils::AP::ParseError</a></span></tt>)</span>
523
+
524
+
525
+
526
+ </li>
527
+
528
+ <li>
529
+
530
+
531
+ <span class='type'>(<tt><span class='object_link'><a href="SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">TermUtils::AP::SyntaxError</a></span></tt>)</span>
532
+
533
+
534
+
535
+ </li>
536
+
537
+ </ul>
538
+
539
+ </div><table class="source_code">
540
+ <tr>
541
+ <td>
542
+ <pre class="lines">
543
+
544
+
545
+ 32
546
+ 33
547
+ 34</pre>
548
+ </td>
549
+ <td>
550
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ap/parser.rb', line 32</span>
551
+
552
+ <span class='kw'>def</span> <span class='id identifier rubyid_parse_command'>parse_command</span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
553
+ <span class='id identifier rubyid_parse_arguments'>parse_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
554
+ <span class='kw'>end</span></pre>
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+
560
+ </div>
561
+
562
+ </div>
563
+
564
+ <div id="footer">
565
+ Generated on Sun Nov 10 18:36:19 2019 by
566
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
567
+ 0.9.20 (ruby-2.6.5).
568
+ </div>
569
+
570
+ </div>
571
+ </body>
572
+ </html>