summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-12 14:27:20 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-12 14:27:20 +0100
commit7d6e2561a4a672e46b7f9d0553a624949b2eb794 (patch)
tree5aa669dec23909e1742d0f0e80b14467ed87470f /src/scripts
parent0f0009cb4f250ecec59debc5b0626d32ed9ee063 (diff)
elua: update eolian name APIs
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua400
-rw-r--r--src/scripts/elua/apps/docgen/stats.lua22
-rw-r--r--src/scripts/elua/apps/gendoc.lua60
-rw-r--r--src/scripts/elua/modules/lualian.lua16
4 files changed, 192 insertions, 306 deletions
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index 31f27b6c26..825ac7365e 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -38,6 +38,23 @@ M.Node = util.Object:clone {
38 PROTECTED = eolian.object_scope.PROTECTED 38 PROTECTED = eolian.object_scope.PROTECTED
39 }, 39 },
40 40
41 __ctor = function(self, obj)
42 self._obj = obj
43 assert(self._obj)
44 end,
45
46 name_get = function(self)
47 return self.obj:name_get()
48 end,
49
50 short_name_get = function(self)
51 return self.obj:short_name_get()
52 end,
53
54 namespaces_get = function(self)
55 return self._obj:namespaces_get():to_array()
56 end,
57
41 nspaces_get = function(self, root) 58 nspaces_get = function(self, root)
42 local tbl = self:namespaces_get() 59 local tbl = self:namespaces_get()
43 -- temporary workaround 60 -- temporary workaround
@@ -48,7 +65,7 @@ M.Node = util.Object:clone {
48 tbl[i] = tbl[i]:lower() 65 tbl[i] = tbl[i]:lower()
49 end 66 end
50 67
51 tbl[#tbl + 1] = self:name_get():lower() 68 tbl[#tbl + 1] = self:short_name_get():lower()
52 if root ~= nil then 69 if root ~= nil then
53 tbl[#tbl + 1] = not not root 70 tbl[#tbl + 1] = not not root
54 end 71 end
@@ -90,36 +107,32 @@ local add_since = function(str, since)
90end 107end
91 108
92M.Doc = Node:clone { 109M.Doc = Node:clone {
93 __ctor = function(self, doc)
94 self.doc = doc
95 end,
96
97 summary_get = function(self) 110 summary_get = function(self)
98 if not self.doc then 111 if not self._obj then
99 return nil 112 return nil
100 end 113 end
101 return self.doc:summary_get() 114 return self._obj:summary_get()
102 end, 115 end,
103 116
104 description_get = function(self) 117 description_get = function(self)
105 if not self.doc then 118 if not self._obj then
106 return nil 119 return nil
107 end 120 end
108 return self.doc:description_get() 121 return self._obj:description_get()
109 end, 122 end,
110 123
111 since_get = function(self) 124 since_get = function(self)
112 if not self.doc then 125 if not self._obj then
113 return nil 126 return nil
114 end 127 end
115 return self.doc:since_get() 128 return self._obj:since_get()
116 end, 129 end,
117 130
118 brief_get = function(self, doc2) 131 brief_get = function(self, doc2)
119 if not self.doc and (not doc2 or not doc2.doc) then 132 if not self._obj and (not doc2 or not doc2._obj) then
120 return "No description supplied." 133 return "No description supplied."
121 end 134 end
122 local doc1, doc2 = self.doc, doc2 and doc2.doc or nil 135 local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
123 if not doc1 then 136 if not doc1 then
124 doc1, doc2 = doc2, doc1 137 doc1, doc2 = doc2, doc1
125 end 138 end
@@ -127,10 +140,10 @@ M.Doc = Node:clone {
127 end, 140 end,
128 141
129 full_get = function(self, doc2, write_since) 142 full_get = function(self, doc2, write_since)
130 if not self.doc and (not doc2 or not doc2.doc) then 143 if not self._obj and (not doc2 or not doc2._obj) then
131 return "No description supplied." 144 return "No description supplied."
132 end 145 end
133 local doc1, doc2 = self.doc, doc2 and doc2.doc or nil 146 local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
134 if not doc1 then 147 if not doc1 then
135 doc1, doc2 = doc2, doc1 148 doc1, doc2 = doc2, doc1
136 end 149 end
@@ -160,7 +173,7 @@ M.Doc = Node:clone {
160 end, 173 end,
161 174
162 exists = function(self) 175 exists = function(self)
163 return not not self.doc 176 return not not self._obj
164 end 177 end
165} 178}
166 179
@@ -181,25 +194,8 @@ M.Class = Node:clone {
181 MIXIN = eolian.class_type.MIXIN, 194 MIXIN = eolian.class_type.MIXIN,
182 INTERFACE = eolian.class_type.INTERFACE, 195 INTERFACE = eolian.class_type.INTERFACE,
183 196
184 __ctor = function(self, cl)
185 self.class = cl
186 assert(self.class)
187 end,
188
189 full_name_get = function(self)
190 return self.class:full_name_get()
191 end,
192
193 name_get = function(self)
194 return self.class:name_get()
195 end,
196
197 namespaces_get = function(self)
198 return self.class:namespaces_get():to_array()
199 end,
200
201 type_get = function(self) 197 type_get = function(self)
202 return self.class:type_get() 198 return self._obj:type_get()
203 end, 199 end,
204 200
205 type_str_get = function(self) 201 type_str_get = function(self)
@@ -216,15 +212,15 @@ M.Class = Node:clone {
216 end, 212 end,
217 213
218 doc_get = function(self) 214 doc_get = function(self)
219 return M.Doc(self.class:documentation_get()) 215 return M.Doc(self._obj:documentation_get())
220 end, 216 end,
221 217
222 legacy_prefix_get = function(self) 218 legacy_prefix_get = function(self)
223 return self.class:legacy_prefix_get() 219 return self._obj:legacy_prefix_get()
224 end, 220 end,
225 221
226 eo_prefix_get = function(self) 222 eo_prefix_get = function(self)
227 return self.class:eo_prefix_get() 223 return self._obj:eo_prefix_get()
228 end, 224 end,
229 225
230 inherits_get = function(self) 226 inherits_get = function(self)
@@ -233,7 +229,7 @@ M.Class = Node:clone {
233 return ret 229 return ret
234 end 230 end
235 ret = {} 231 ret = {}
236 for cl in self.class:inherits_get() do 232 for cl in self._obj:inherits_get() do
237 ret[#ret + 1] = M.Class(cl) 233 ret[#ret + 1] = M.Class(cl)
238 end 234 end
239 self._cache_inhc = ret 235 self._cache_inhc = ret
@@ -241,7 +237,7 @@ M.Class = Node:clone {
241 end, 237 end,
242 238
243 children_get = function(self) 239 children_get = function(self)
244 return revh[self:full_name_get()] or {} 240 return revh[self:name_get()] or {}
245 end, 241 end,
246 242
247 functions_get = function(self, ft) 243 functions_get = function(self, ft)
@@ -251,7 +247,7 @@ M.Class = Node:clone {
251 end 247 end
252 ret = {} 248 ret = {}
253 self._cache_funcs = ret 249 self._cache_funcs = ret
254 for fn in self.class:functions_get(ft) do 250 for fn in self._obj:functions_get(ft) do
255 ret[#ret + 1] = M.Function(fn) 251 ret[#ret + 1] = M.Function(fn)
256 end 252 end
257 return ret 253 return ret
@@ -262,14 +258,14 @@ M.Class = Node:clone {
262 if fun then 258 if fun then
263 return fun 259 return fun
264 end 260 end
265 fun = M.Function(self.class:function_get_by_name(fn, ft)) 261 fun = M.Function(self._obj:function_get_by_name(fn, ft))
266 self._cache_func = fun 262 self._cache_func = fun
267 return fun 263 return fun
268 end, 264 end,
269 265
270 events_get = function(self) 266 events_get = function(self)
271 local ret = {} 267 local ret = {}
272 for ev in self.class:events_get() do 268 for ev in self._obj:events_get() do
273 ret[#ret + 1] = M.Event(ev) 269 ret[#ret + 1] = M.Event(ev)
274 end 270 end
275 return ret 271 return ret
@@ -277,14 +273,14 @@ M.Class = Node:clone {
277 273
278 implements_get = function(self) 274 implements_get = function(self)
279 local ret = {} 275 local ret = {}
280 for impl in self.class:implements_get() do 276 for impl in self._obj:implements_get() do
281 ret[#ret + 1] = M.Implement(impl) 277 ret[#ret + 1] = M.Implement(impl)
282 end 278 end
283 return ret 279 return ret
284 end, 280 end,
285 281
286 c_get_function_name_get = function(self) 282 c_get_function_name_get = function(self)
287 return self.class:c_get_function_name_get() 283 return self._obj:c_get_function_name_get()
288 end, 284 end,
289 285
290 nspaces_get = function(self, root) 286 nspaces_get = function(self, root)
@@ -292,7 +288,7 @@ M.Class = Node:clone {
292 end, 288 end,
293 289
294 is_same = function(self, other) 290 is_same = function(self, other)
295 return self.class == other.class 291 return self._obj == other._obj
296 end, 292 end,
297 293
298 -- static getters 294 -- static getters
@@ -360,17 +356,8 @@ M.Function = Node:clone {
360 METHOD = eolian.function_type.METHOD, 356 METHOD = eolian.function_type.METHOD,
361 FUNCTION_POINTER = eolian.function_type.FUNCTION_POINTER, 357 FUNCTION_POINTER = eolian.function_type.FUNCTION_POINTER,
362 358
363 __ctor = function(self, fn)
364 self.func = fn
365 assert(self.func)
366 end,
367
368 name_get = function(self)
369 return self.func:name_get()
370 end,
371
372 type_get = function(self) 359 type_get = function(self)
373 return self.func:type_get() 360 return self._obj:type_get()
374 end, 361 end,
375 362
376 type_str_get = function(self) 363 type_str_get = function(self)
@@ -378,44 +365,44 @@ M.Function = Node:clone {
378 end, 365 end,
379 366
380 scope_get = function(self, ft) 367 scope_get = function(self, ft)
381 return self.func:scope_get(ft) 368 return self._obj:scope_get(ft)
382 end, 369 end,
383 370
384 full_c_name_get = function(self, ft, legacy) 371 full_c_name_get = function(self, ft, legacy)
385 return self.func:full_c_name_get(ft, legacy) 372 return self._obj:full_c_name_get(ft, legacy)
386 end, 373 end,
387 374
388 legacy_get = function(self, ft) 375 legacy_get = function(self, ft)
389 return self.func:legacy_get(ft) 376 return self._obj:legacy_get(ft)
390 end, 377 end,
391 378
392 implement_get = function(self) 379 implement_get = function(self)
393 return M.Implement(self.func:implement_get()) 380 return M.Implement(self._obj:implement_get())
394 end, 381 end,
395 382
396 is_legacy_only = function(self, ft) 383 is_legacy_only = function(self, ft)
397 return self.func:is_legacy_only(ft) 384 return self._obj:is_legacy_only(ft)
398 end, 385 end,
399 386
400 is_class = function(self) 387 is_class = function(self)
401 return self.func:is_class() 388 return self._obj:is_class()
402 end, 389 end,
403 390
404 is_beta = function(self) 391 is_beta = function(self)
405 return self.func:is_beta() 392 return self._obj:is_beta()
406 end, 393 end,
407 394
408 is_constructor = function(self, klass) 395 is_constructor = function(self, klass)
409 return self.func:is_constructor(klass.class) 396 return self._obj:is_constructor(klass.class)
410 end, 397 end,
411 398
412 is_function_pointer = function(self) 399 is_function_pointer = function(self)
413 return self.func:is_function_pointer() 400 return self._obj:is_function_pointer()
414 end, 401 end,
415 402
416 property_keys_get = function(self, ft) 403 property_keys_get = function(self, ft)
417 local ret = {} 404 local ret = {}
418 for par in self.func:property_keys_get(ft) do 405 for par in self._obj:property_keys_get(ft) do
419 ret[#ret + 1] = M.Parameter(par) 406 ret[#ret + 1] = M.Parameter(par)
420 end 407 end
421 return ret 408 return ret
@@ -423,7 +410,7 @@ M.Function = Node:clone {
423 410
424 property_values_get = function(self, ft) 411 property_values_get = function(self, ft)
425 local ret = {} 412 local ret = {}
426 for par in self.func:property_values_get(ft) do 413 for par in self._obj:property_values_get(ft) do
427 ret[#ret + 1] = M.Parameter(par) 414 ret[#ret + 1] = M.Parameter(par)
428 end 415 end
429 return ret 416 return ret
@@ -431,14 +418,14 @@ M.Function = Node:clone {
431 418
432 parameters_get = function(self) 419 parameters_get = function(self)
433 local ret = {} 420 local ret = {}
434 for par in self.func:parameters_get() do 421 for par in self._obj:parameters_get() do
435 ret[#ret + 1] = M.Parameter(par) 422 ret[#ret + 1] = M.Parameter(par)
436 end 423 end
437 return ret 424 return ret
438 end, 425 end,
439 426
440 return_type_get = function(self, ft) 427 return_type_get = function(self, ft)
441 local v = self.func:return_type_get(ft) 428 local v = self._obj:return_type_get(ft)
442 if not v then 429 if not v then
443 return nil 430 return nil
444 end 431 end
@@ -446,7 +433,7 @@ M.Function = Node:clone {
446 end, 433 end,
447 434
448 return_default_value_get = function(self, ft) 435 return_default_value_get = function(self, ft)
449 local v = self.func:return_default_value_get(ft) 436 local v = self._obj:return_default_value_get(ft)
450 if not v then 437 if not v then
451 return nil 438 return nil
452 end 439 end
@@ -454,15 +441,15 @@ M.Function = Node:clone {
454 end, 441 end,
455 442
456 return_doc_get = function(self, ft) 443 return_doc_get = function(self, ft)
457 return M.Doc(self.func:return_documentation_get(ft)) 444 return M.Doc(self._obj:return_documentation_get(ft))
458 end, 445 end,
459 446
460 return_is_warn_unused = function(self, ft) 447 return_is_warn_unused = function(self, ft)
461 return self.func:return_is_warn_unused(ft) 448 return self._obj:return_is_warn_unused(ft)
462 end, 449 end,
463 450
464 is_const = function(self) 451 is_const = function(self)
465 return self.func:is_const() 452 return self._obj:is_const()
466 end, 453 end,
467 454
468 nspaces_get = function(self, cl, root) 455 nspaces_get = function(self, cl, root)
@@ -476,11 +463,11 @@ M.Function = Node:clone {
476 end, 463 end,
477 464
478 is_same = function(self, other) 465 is_same = function(self, other)
479 return self.func == other.func 466 return self._obj == other._obj
480 end, 467 end,
481 468
482 id_get = function(self) 469 id_get = function(self)
483 return tonumber(ffi.cast("uintptr_t", self.func)) 470 return tonumber(ffi.cast("uintptr_t", self._obj))
484 end 471 end
485} 472}
486 473
@@ -490,13 +477,8 @@ M.Parameter = Node:clone {
490 OUT = eolian.parameter_dir.OUT, 477 OUT = eolian.parameter_dir.OUT,
491 INOUT = eolian.parameter_dir.INOUT, 478 INOUT = eolian.parameter_dir.INOUT,
492 479
493 __ctor = function(self, par)
494 self.param = par
495 assert(self.param)
496 end,
497
498 direction_get = function(self) 480 direction_get = function(self)
499 return self.param:direction_get() 481 return self._obj:direction_get()
500 end, 482 end,
501 483
502 direction_name_get = function(self) 484 direction_name_get = function(self)
@@ -510,7 +492,7 @@ M.Parameter = Node:clone {
510 end, 492 end,
511 493
512 type_get = function(self) 494 type_get = function(self)
513 local v = self.param:type_get() 495 local v = self._obj:type_get()
514 if not v then 496 if not v then
515 return nil 497 return nil
516 end 498 end
@@ -518,50 +500,37 @@ M.Parameter = Node:clone {
518 end, 500 end,
519 501
520 default_value_get = function(self) 502 default_value_get = function(self)
521 local v = self.param:default_value_get() 503 local v = self._obj:default_value_get()
522 if not v then 504 if not v then
523 return nil 505 return nil
524 end 506 end
525 return M.Expression(v) 507 return M.Expression(v)
526 end, 508 end,
527 509
528 name_get = function(self)
529 return self.param:name_get()
530 end,
531
532 doc_get = function(self) 510 doc_get = function(self)
533 return M.Doc(self.param:documentation_get()) 511 return M.Doc(self._obj:documentation_get())
534 end, 512 end,
535 513
536 is_nonull = function(self) 514 is_nonull = function(self)
537 return self.param:is_nonull() 515 return self._obj:is_nonull()
538 end, 516 end,
539 517
540 is_nullable = function(self) 518 is_nullable = function(self)
541 return self.param:is_nullable() 519 return self._obj:is_nullable()
542 end, 520 end,
543 521
544 is_optional = function(self) 522 is_optional = function(self)
545 return self.param:is_optional() 523 return self._obj:is_optional()
546 end, 524 end,
547 525
548 is_same = function(self, other) 526 is_same = function(self, other)
549 return self.param == other.param 527 return self._obj == other._obj
550 end 528 end
551} 529}
552 530
553M.Event = Node:clone { 531M.Event = Node:clone {
554 __ctor = function(self, ev)
555 self.event = ev
556 assert(self.event)
557 end,
558
559 name_get = function(self)
560 return self.event:name_get()
561 end,
562
563 type_get = function(self) 532 type_get = function(self)
564 local v = self.event:type_get() 533 local v = self._obj:type_get()
565 if not v then 534 if not v then
566 return nil 535 return nil
567 end 536 end
@@ -569,27 +538,27 @@ M.Event = Node:clone {
569 end, 538 end,
570 539
571 doc_get = function(self) 540 doc_get = function(self)
572 return M.Doc(self.event:documentation_get()) 541 return M.Doc(self._obj:documentation_get())
573 end, 542 end,
574 543
575 scope_get = function(self) 544 scope_get = function(self)
576 return self.event:scope_get() 545 return self._obj:scope_get()
577 end, 546 end,
578 547
579 c_name_get = function(self) 548 c_name_get = function(self)
580 return self.event:c_name_get() 549 return self._obj:c_name_get()
581 end, 550 end,
582 551
583 is_beta = function(self) 552 is_beta = function(self)
584 return self.event:is_beta() 553 return self._obj:is_beta()
585 end, 554 end,
586 555
587 is_hot = function(self) 556 is_hot = function(self)
588 return self.event:is_hot() 557 return self._obj:is_hot()
589 end, 558 end,
590 559
591 is_restart = function(self) 560 is_restart = function(self)
592 return self.event:is_restart() 561 return self._obj:is_restart()
593 end, 562 end,
594 563
595 nspaces_get = function(self, cl, root) 564 nspaces_get = function(self, cl, root)
@@ -604,21 +573,12 @@ M.Event = Node:clone {
604} 573}
605 574
606M.StructField = Node:clone { 575M.StructField = Node:clone {
607 __ctor = function(self, fl)
608 self.field = fl
609 assert(self.field)
610 end,
611
612 name_get = function(self)
613 return self.field:name_get()
614 end,
615
616 doc_get = function(self) 576 doc_get = function(self)
617 return M.Doc(self.field:documentation_get()) 577 return M.Doc(self._obj:documentation_get())
618 end, 578 end,
619 579
620 type_get = function(self) 580 type_get = function(self)
621 local v = self.field:type_get() 581 local v = self._obj:type_get()
622 if not v then 582 if not v then
623 return nil 583 return nil
624 end 584 end
@@ -627,25 +587,16 @@ M.StructField = Node:clone {
627} 587}
628 588
629M.EnumField = Node:clone { 589M.EnumField = Node:clone {
630 __ctor = function(self, fl)
631 self.field = fl
632 assert(self.field)
633 end,
634
635 name_get = function(self)
636 return self.field:name_get()
637 end,
638
639 c_name_get = function(self) 590 c_name_get = function(self)
640 return self.field:c_name_get() 591 return self._obj:c_name_get()
641 end, 592 end,
642 593
643 doc_get = function(self) 594 doc_get = function(self)
644 return M.Doc(self.field:documentation_get()) 595 return M.Doc(self._obj:documentation_get())
645 end, 596 end,
646 597
647 value_get = function(self, force) 598 value_get = function(self, force)
648 local v = self.field:value_get(force) 599 local v = self._obj:value_get(force)
649 if not v then 600 if not v then
650 return nil 601 return nil
651 end 602 end
@@ -678,21 +629,16 @@ M.Type = Node:clone {
678 CLASS = eolian.type_type.CLASS, 629 CLASS = eolian.type_type.CLASS,
679 UNDEFINED = eolian.type_type.UNDEFINED, 630 UNDEFINED = eolian.type_type.UNDEFINED,
680 631
681 __ctor = function(self, tp)
682 self.type = tp
683 assert(self.type)
684 end,
685
686 type_get = function(self) 632 type_get = function(self)
687 return self.type:type_get() 633 return self._obj:type_get()
688 end, 634 end,
689 635
690 file_get = function(self) 636 file_get = function(self)
691 return self.type:file_get() 637 return self._obj:file_get()
692 end, 638 end,
693 639
694 base_type_get = function(self) 640 base_type_get = function(self)
695 local v = self.type:base_type_get() 641 local v = self._obj:base_type_get()
696 if not v then 642 if not v then
697 return nil 643 return nil
698 end 644 end
@@ -700,7 +646,7 @@ M.Type = Node:clone {
700 end, 646 end,
701 647
702 next_type_get = function(self) 648 next_type_get = function(self)
703 local v = self.type:next_type_get() 649 local v = self._obj:next_type_get()
704 if not v then 650 if not v then
705 return nil 651 return nil
706 end 652 end
@@ -708,7 +654,7 @@ M.Type = Node:clone {
708 end, 654 end,
709 655
710 typedecl_get = function(self) 656 typedecl_get = function(self)
711 local v = self.type:typedecl_get() 657 local v = self._obj:typedecl_get()
712 if not v then 658 if not v then
713 return nil 659 return nil
714 end 660 end
@@ -716,7 +662,7 @@ M.Type = Node:clone {
716 end, 662 end,
717 663
718 aliased_base_get = function(self) 664 aliased_base_get = function(self)
719 local v = self.type:aliased_base_get() 665 local v = self._obj:aliased_base_get()
720 if not v then 666 if not v then
721 return nil 667 return nil
722 end 668 end
@@ -725,39 +671,27 @@ M.Type = Node:clone {
725 671
726 class_get = function(self) 672 class_get = function(self)
727 -- FIXME: unit 673 -- FIXME: unit
728 return self.type:class_get(eos:unit_get()) 674 return self._obj:class_get(eos:unit_get())
729 end, 675 end,
730 676
731 is_owned = function(self) 677 is_owned = function(self)
732 return self.type:is_owned() 678 return self._obj:is_owned()
733 end, 679 end,
734 680
735 is_const = function(self) 681 is_const = function(self)
736 return self.type:is_const() 682 return self._obj:is_const()
737 end, 683 end,
738 684
739 is_ptr = function(self) 685 is_ptr = function(self)
740 return self.type:is_ptr() 686 return self._obj:is_ptr()
741 end, 687 end,
742 688
743 c_type_get = function(self) 689 c_type_get = function(self)
744 return self.type:c_type_get(eolian.c_type_type.DEFAULT) 690 return self._obj:c_type_get(eolian.c_type_type.DEFAULT)
745 end,
746
747 name_get = function(self)
748 return self.type:name_get()
749 end,
750
751 full_name_get = function(self)
752 return self.type:full_name_get()
753 end,
754
755 namespaces_get = function(self)
756 return self.type:namespaces_get()
757 end, 691 end,
758 692
759 free_func_get = function(self) 693 free_func_get = function(self)
760 return self.type:free_func_get() 694 return self._obj:free_func_get()
761 end, 695 end,
762 696
763 -- utils 697 -- utils
@@ -765,7 +699,7 @@ M.Type = Node:clone {
765 serialize = function(self) 699 serialize = function(self)
766 local tpt = self:type_get() 700 local tpt = self:type_get()
767 if tpt == self.UNKNOWN then 701 if tpt == self.UNKNOWN then
768 error("unknown type: " .. self:full_name_get()) 702 error("unknown type: " .. self:name_get())
769 elseif tpt == self.VOID then 703 elseif tpt == self.VOID then
770 return wrap_type_attrs(self, "void") 704 return wrap_type_attrs(self, "void")
771 elseif tpt == self.UNDEFINED then 705 elseif tpt == self.UNDEFINED then
@@ -778,10 +712,10 @@ M.Type = Node:clone {
778 stypes[#stypes + 1] = stp:serialize() 712 stypes[#stypes + 1] = stp:serialize()
779 stp = stp:next_type_get() 713 stp = stp:next_type_get()
780 end 714 end
781 return wrap_type_attrs(self, self:full_name_get() .. "<" 715 return wrap_type_attrs(self, self:name_get() .. "<"
782 .. table.concat(stypes, ", ") .. ">") 716 .. table.concat(stypes, ", ") .. ">")
783 end 717 end
784 return wrap_type_attrs(self, self:full_name_get()) 718 return wrap_type_attrs(self, self:name_get())
785 end 719 end
786 error("unhandled type type: " .. tpt) 720 error("unhandled type type: " .. tpt)
787 end 721 end
@@ -820,13 +754,8 @@ M.Typedecl = Node:clone {
820 ALIAS = eolian.typedecl_type.ALIAS, 754 ALIAS = eolian.typedecl_type.ALIAS,
821 FUNCTION_POINTER = eolian.typedecl_type.FUNCTION_POINTER, 755 FUNCTION_POINTER = eolian.typedecl_type.FUNCTION_POINTER,
822 756
823 __ctor = function(self, tp)
824 self.typedecl = tp
825 assert(self.typedecl)
826 end,
827
828 type_get = function(self) 757 type_get = function(self)
829 return self.typedecl:type_get() 758 return self._obj:type_get()
830 end, 759 end,
831 760
832 type_str_get = function(self) 761 type_str_get = function(self)
@@ -841,14 +770,14 @@ M.Typedecl = Node:clone {
841 770
842 struct_fields_get = function(self) 771 struct_fields_get = function(self)
843 local ret = {} 772 local ret = {}
844 for fl in self.typedecl:struct_fields_get() do 773 for fl in self._obj:struct_fields_get() do
845 ret[#ret + 1] = M.StructField(fl) 774 ret[#ret + 1] = M.StructField(fl)
846 end 775 end
847 return ret 776 return ret
848 end, 777 end,
849 778
850 struct_field_get = function(self, name) 779 struct_field_get = function(self, name)
851 local v = self.typedecl:struct_field_get(name) 780 local v = self._obj:struct_field_get(name)
852 if not v then 781 if not v then
853 return nil 782 return nil
854 end 783 end
@@ -857,14 +786,14 @@ M.Typedecl = Node:clone {
857 786
858 enum_fields_get = function(self) 787 enum_fields_get = function(self)
859 local ret = {} 788 local ret = {}
860 for fl in self.typedecl:enum_fields_get() do 789 for fl in self._obj:enum_fields_get() do
861 ret[#ret + 1] = M.EnumField(fl) 790 ret[#ret + 1] = M.EnumField(fl)
862 end 791 end
863 return ret 792 return ret
864 end, 793 end,
865 794
866 enum_field_get = function(self, name) 795 enum_field_get = function(self, name)
867 local v = self.typedecl:enum_field_get(name) 796 local v = self._obj:enum_field_get(name)
868 if not v then 797 if not v then
869 return nil 798 return nil
870 end 799 end
@@ -872,19 +801,19 @@ M.Typedecl = Node:clone {
872 end, 801 end,
873 802
874 enum_legacy_prefix_get = function(self) 803 enum_legacy_prefix_get = function(self)
875 return self.typedecl:enum_legacy_prefix_get() 804 return self._obj:enum_legacy_prefix_get()
876 end, 805 end,
877 806
878 doc_get = function(self) 807 doc_get = function(self)
879 return M.Doc(self.typedecl:documentation_get()) 808 return M.Doc(self._obj:documentation_get())
880 end, 809 end,
881 810
882 file_get = function(self) 811 file_get = function(self)
883 return self.typedecl:file_get() 812 return self._obj:file_get()
884 end, 813 end,
885 814
886 base_type_get = function(self) 815 base_type_get = function(self)
887 local v = self.typedecl:base_type_get() 816 local v = self._obj:base_type_get()
888 if not v then 817 if not v then
889 return nil 818 return nil
890 end 819 end
@@ -892,7 +821,7 @@ M.Typedecl = Node:clone {
892 end, 821 end,
893 822
894 aliased_base_get = function(self) 823 aliased_base_get = function(self)
895 local v = self.typedecl:aliased_base_get() 824 local v = self._obj:aliased_base_get()
896 if not v then 825 if not v then
897 return nil 826 return nil
898 end 827 end
@@ -900,31 +829,19 @@ M.Typedecl = Node:clone {
900 end, 829 end,
901 830
902 is_extern = function(self) 831 is_extern = function(self)
903 return self.typedecl:is_extern() 832 return self._obj:is_extern()
904 end, 833 end,
905 834
906 c_type_get = function(self) 835 c_type_get = function(self)
907 return self.typedecl:c_type_get() 836 return self._obj:c_type_get()
908 end,
909
910 name_get = function(self)
911 return self.typedecl:name_get()
912 end,
913
914 full_name_get = function(self)
915 return self.typedecl:full_name_get()
916 end,
917
918 namespaces_get = function(self)
919 return self.typedecl:namespaces_get():to_array()
920 end, 837 end,
921 838
922 free_func_get = function(self) 839 free_func_get = function(self)
923 return self.typedecl:free_func_get() 840 return self._obj:free_func_get()
924 end, 841 end,
925 842
926 function_pointer_get = function(self) 843 function_pointer_get = function(self)
927 local v = self.typedecl:function_pointer_get() 844 local v = self._obj:function_pointer_get()
928 if not v then 845 if not v then
929 return nil 846 return nil
930 end 847 end
@@ -1024,12 +941,12 @@ M.Typedecl = Node:clone {
1024 serialize = function(self) 941 serialize = function(self)
1025 local tpt = self:type_get() 942 local tpt = self:type_get()
1026 if tpt == self.UNKNOWN then 943 if tpt == self.UNKNOWN then
1027 error("unknown typedecl: " .. self:full_name_get()) 944 error("unknown typedecl: " .. self:name_get())
1028 elseif tpt == self.STRUCT or 945 elseif tpt == self.STRUCT or
1029 tpt == self.STRUCT_OPAQUE then 946 tpt == self.STRUCT_OPAQUE then
1030 local buf = { "struct " } 947 local buf = { "struct " }
1031 add_typedecl_attrs(self, buf) 948 add_typedecl_attrs(self, buf)
1032 buf[#buf + 1] = self:full_name_get() 949 buf[#buf + 1] = self:name_get()
1033 if tpt == self.STRUCT_OPAQUE then 950 if tpt == self.STRUCT_OPAQUE then
1034 buf[#buf + 1] = ";" 951 buf[#buf + 1] = ";"
1035 return table.concat(buf) 952 return table.concat(buf)
@@ -1052,7 +969,7 @@ M.Typedecl = Node:clone {
1052 elseif tpt == self.ENUM then 969 elseif tpt == self.ENUM then
1053 local buf = { "enum " } 970 local buf = { "enum " }
1054 add_typedecl_attrs(self, buf) 971 add_typedecl_attrs(self, buf)
1055 buf[#buf + 1] = self:full_name_get() 972 buf[#buf + 1] = self:name_get()
1056 local fields = self:enum_fields_get() 973 local fields = self:enum_fields_get()
1057 if #fields == 0 then 974 if #fields == 0 then
1058 buf[#buf + 1] = " {}" 975 buf[#buf + 1] = " {}"
@@ -1078,7 +995,7 @@ M.Typedecl = Node:clone {
1078 elseif tpt == self.ALIAS then 995 elseif tpt == self.ALIAS then
1079 local buf = { "type " } 996 local buf = { "type " }
1080 add_typedecl_attrs(self, buf) 997 add_typedecl_attrs(self, buf)
1081 buf[#buf + 1] = self:full_name_get() 998 buf[#buf + 1] = self:name_get()
1082 buf[#buf + 1] = ": " 999 buf[#buf + 1] = ": "
1083 buf[#buf + 1] = self:base_type_get():serialize() 1000 buf[#buf + 1] = self:base_type_get():serialize()
1084 buf[#buf + 1] = ";" 1001 buf[#buf + 1] = ";"
@@ -1092,11 +1009,11 @@ M.Typedecl = Node:clone {
1092 serialize_c = function(self, ns) 1009 serialize_c = function(self, ns)
1093 local tpt = self:type_get() 1010 local tpt = self:type_get()
1094 if tpt == self.UNKNOWN then 1011 if tpt == self.UNKNOWN then
1095 error("unknown typedecl: " .. self:full_name_get()) 1012 error("unknown typedecl: " .. self:name_get())
1096 elseif tpt == self.STRUCT or 1013 elseif tpt == self.STRUCT or
1097 tpt == self.STRUCT_OPAQUE then 1014 tpt == self.STRUCT_OPAQUE then
1098 local buf = { "typedef struct " } 1015 local buf = { "typedef struct " }
1099 local fulln = self:full_name_get():gsub("%.", "_"); 1016 local fulln = self:name_get():gsub("%.", "_");
1100 keyref.add(fulln, ns, "c") 1017 keyref.add(fulln, ns, "c")
1101 buf[#buf + 1] = "_" .. fulln; 1018 buf[#buf + 1] = "_" .. fulln;
1102 if tpt == self.STRUCT_OPAQUE then 1019 if tpt == self.STRUCT_OPAQUE then
@@ -1118,7 +1035,7 @@ M.Typedecl = Node:clone {
1118 return table.concat(buf) 1035 return table.concat(buf)
1119 elseif tpt == self.ENUM then 1036 elseif tpt == self.ENUM then
1120 local buf = { "typedef enum" } 1037 local buf = { "typedef enum" }
1121 local fulln = self:full_name_get():gsub("%.", "_"); 1038 local fulln = self:name_get():gsub("%.", "_");
1122 keyref.add(fulln, ns, "c") 1039 keyref.add(fulln, ns, "c")
1123 local fields = self:enum_fields_get() 1040 local fields = self:enum_fields_get()
1124 if #fields == 0 then 1041 if #fields == 0 then
@@ -1151,7 +1068,7 @@ M.Typedecl = Node:clone {
1151 buf[#buf + 1] = "} " .. fulln .. ";" 1068 buf[#buf + 1] = "} " .. fulln .. ";"
1152 return table.concat(buf) 1069 return table.concat(buf)
1153 elseif tpt == self.ALIAS then 1070 elseif tpt == self.ALIAS then
1154 local fulln = self:full_name_get():gsub("%.", "_"); 1071 local fulln = self:name_get():gsub("%.", "_");
1155 keyref.add(fulln, ns, "c") 1072 keyref.add(fulln, ns, "c")
1156 return "typedef " 1073 return "typedef "
1157 .. M.type_cstr_get(self:base_type_get(), fulln) .. ";" 1074 .. M.type_cstr_get(self:base_type_get(), fulln) .. ";"
@@ -1167,13 +1084,8 @@ M.Variable = Node:clone {
1167 CONSTANT = eolian.variable_type.CONSTANT, 1084 CONSTANT = eolian.variable_type.CONSTANT,
1168 GLOBAL = eolian.variable_type.GLOBAL, 1085 GLOBAL = eolian.variable_type.GLOBAL,
1169 1086
1170 __ctor = function(self, var)
1171 self.variable = var
1172 assert(self.variable)
1173 end,
1174
1175 type_get = function(self) 1087 type_get = function(self)
1176 return self.variable:type_get() 1088 return self._obj:type_get()
1177 end, 1089 end,
1178 1090
1179 type_str_get = function(self) 1091 type_str_get = function(self)
@@ -1185,15 +1097,15 @@ M.Variable = Node:clone {
1185 end, 1097 end,
1186 1098
1187 doc_get = function(self) 1099 doc_get = function(self)
1188 return M.Doc(self.variable:documentation_get()) 1100 return M.Doc(self._obj:documentation_get())
1189 end, 1101 end,
1190 1102
1191 file_get = function(self) 1103 file_get = function(self)
1192 return self.variable:file_get() 1104 return self._obj:file_get()
1193 end, 1105 end,
1194 1106
1195 base_type_get = function(self) 1107 base_type_get = function(self)
1196 local v = self.variable:base_type_get() 1108 local v = self._obj:base_type_get()
1197 if not v then 1109 if not v then
1198 return nil 1110 return nil
1199 end 1111 end
@@ -1201,27 +1113,15 @@ M.Variable = Node:clone {
1201 end, 1113 end,
1202 1114
1203 value_get = function(self) 1115 value_get = function(self)
1204 local v = self.variable:value_get() 1116 local v = self._obj:value_get()
1205 if not v then 1117 if not v then
1206 return nil 1118 return nil
1207 end 1119 end
1208 return M.Expression(v) 1120 return M.Expression(v)
1209 end, 1121 end,
1210 1122
1211 name_get = function(self)
1212 return self.variable:name_get()
1213 end,
1214
1215 full_name_get = function(self)
1216 return self.variable:full_name_get()
1217 end,
1218
1219 namespaces_get = function(self)
1220 return self.variable:namespaces_get():to_array()
1221 end,
1222
1223 is_extern = function(self) 1123 is_extern = function(self)
1224 return self.variable:is_extern() 1124 return self._obj:is_extern()
1225 end, 1125 end,
1226 1126
1227 nspaces_get = function(self, root) 1127 nspaces_get = function(self, root)
@@ -1238,7 +1138,7 @@ M.Variable = Node:clone {
1238 if self:is_extern() then 1138 if self:is_extern() then
1239 buf[#buf + 1] = "@extern " 1139 buf[#buf + 1] = "@extern "
1240 end 1140 end
1241 buf[#buf + 1] = self:full_name_get() 1141 buf[#buf + 1] = self:name_get()
1242 buf[#buf + 1] = ": " 1142 buf[#buf + 1] = ": "
1243 buf[#buf + 1] = self:base_type_get():serialize() 1143 buf[#buf + 1] = self:base_type_get():serialize()
1244 local val = self:value_get() 1144 local val = self:value_get()
@@ -1253,7 +1153,7 @@ M.Variable = Node:clone {
1253 serialize_c = function(self, ns) 1153 serialize_c = function(self, ns)
1254 local buf = {} 1154 local buf = {}
1255 local bt = self:base_type_get() 1155 local bt = self:base_type_get()
1256 local fulln = self:full_name_get():gsub("%.", "_"):upper() 1156 local fulln = self:name_get():gsub("%.", "_"):upper()
1257 keyref.add(fulln, ns, "c") 1157 keyref.add(fulln, ns, "c")
1258 if self:type_get() == self.GLOBAL then 1158 if self:type_get() == self.GLOBAL then
1259 local ts = bt:c_type_get() 1159 local ts = bt:c_type_get()
@@ -1342,41 +1242,27 @@ M.Variable = Node:clone {
1342} 1242}
1343 1243
1344M.Expression = Node:clone { 1244M.Expression = Node:clone {
1345 __ctor = function(self, expr)
1346 self.expr = expr
1347 assert(self.expr)
1348 end,
1349
1350 eval_enum = function(self) 1245 eval_enum = function(self)
1351 return self.expr:eval(eolian.expression_mask.INT) 1246 return self._obj:eval(eolian.expression_mask.INT)
1352 end, 1247 end,
1353 1248
1354 eval_type = function(self, tp) 1249 eval_type = function(self, tp)
1355 return self.expr:eval_type(tp.type) 1250 return self._obj:eval_type(tp.type)
1356 end, 1251 end,
1357 1252
1358 serialize = function(self) 1253 serialize = function(self)
1359 return self.expr:serialize() 1254 return self._obj:serialize()
1360 end 1255 end
1361} 1256}
1362 1257
1363M.Implement = Node:clone { 1258M.Implement = Node:clone {
1364 __ctor = function(self, impl)
1365 self.impl = impl
1366 assert(self.impl)
1367 end,
1368
1369 full_name_get = function(self)
1370 return self.impl:full_name_get()
1371 end,
1372
1373 class_get = function(self) 1259 class_get = function(self)
1374 local ccl = self._cache_cl 1260 local ccl = self._cache_cl
1375 if ccl then 1261 if ccl then
1376 return ccl 1262 return ccl
1377 end 1263 end
1378 -- so that we don't re-instantiate, it gets cached over there too 1264 -- so that we don't re-instantiate, it gets cached over there too
1379 ccl = M.Class.by_name_get(self.impl:class_get():full_name_get()) 1265 ccl = M.Class.by_name_get(self._obj:class_get():name_get())
1380 self._cache_cl = ccl 1266 self._cache_cl = ccl
1381 return ccl 1267 return ccl
1382 end, 1268 end,
@@ -1386,14 +1272,14 @@ M.Implement = Node:clone {
1386 if func then 1272 if func then
1387 return func, tp 1273 return func, tp
1388 end 1274 end
1389 func, tp = self.impl:function_get() 1275 func, tp = self._obj:function_get()
1390 func = M.Function(func) 1276 func = M.Function(func)
1391 self._cache_func, self._cache_tp = func, tp 1277 self._cache_func, self._cache_tp = func, tp
1392 return func, tp 1278 return func, tp
1393 end, 1279 end,
1394 1280
1395 doc_get = function(self, ftype, inh) 1281 doc_get = function(self, ftype, inh)
1396 return M.Doc(self.impl:documentation_get(ftype)) 1282 return M.Doc(self._obj:documentation_get(ftype))
1397 end, 1283 end,
1398 1284
1399 fallback_doc_get = function(self, inh) 1285 fallback_doc_get = function(self, inh)
@@ -1407,31 +1293,31 @@ M.Implement = Node:clone {
1407 end, 1293 end,
1408 1294
1409 is_auto = function(self, ftype) 1295 is_auto = function(self, ftype)
1410 return self.impl:is_auto(ftype) 1296 return self._obj:is_auto(ftype)
1411 end, 1297 end,
1412 1298
1413 is_empty = function(self, ftype) 1299 is_empty = function(self, ftype)
1414 return self.impl:is_empty(ftype) 1300 return self._obj:is_empty(ftype)
1415 end, 1301 end,
1416 1302
1417 is_pure_virtual = function(self, ftype) 1303 is_pure_virtual = function(self, ftype)
1418 return self.impl:is_pure_virtual(ftype) 1304 return self._obj:is_pure_virtual(ftype)
1419 end, 1305 end,
1420 1306
1421 is_prop_get = function(self) 1307 is_prop_get = function(self)
1422 return self.impl:is_prop_get() 1308 return self._obj:is_prop_get()
1423 end, 1309 end,
1424 1310
1425 is_prop_set = function(self) 1311 is_prop_set = function(self)
1426 return self.impl:is_prop_set() 1312 return self._obj:is_prop_set()
1427 end, 1313 end,
1428 1314
1429 is_overridden = function(self, cl) 1315 is_overridden = function(self, cl)
1430 return cl.class ~= self.impl:class_get() 1316 return cl.class ~= self._obj:class_get()
1431 end 1317 end
1432} 1318}
1433 1319
1434M.DocTokenizer = Node:clone { 1320M.DocTokenizer = util.Object:clone {
1435 UNKNOWN = eolian.doc_token_type.UNKNOWN, 1321 UNKNOWN = eolian.doc_token_type.UNKNOWN,
1436 TEXT = eolian.doc_token_type.TEXT, 1322 TEXT = eolian.doc_token_type.TEXT,
1437 REF = eolian.doc_token_type.REF, 1323 REF = eolian.doc_token_type.REF,
@@ -1469,7 +1355,7 @@ M.DocTokenizer = Node:clone {
1469 if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then 1355 if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then
1470 if not class_type_str[d1:type_get()] then 1356 if not class_type_str[d1:type_get()] then
1471 error("unknown class type for class '" 1357 error("unknown class type for class '"
1472 .. d1:full_name_get() .. "'") 1358 .. d1:name_get() .. "'")
1473 end 1359 end
1474 elseif tp == reft.ALIAS then 1360 elseif tp == reft.ALIAS then
1475 elseif tp == reft.STRUCT or tp == reft.STRUCT_FIELD then 1361 elseif tp == reft.STRUCT or tp == reft.STRUCT_FIELD then
@@ -1480,7 +1366,7 @@ M.DocTokenizer = Node:clone {
1480 else 1366 else
1481 error("invalid reference '" .. self:text_get() .. "'") 1367 error("invalid reference '" .. self:text_get() .. "'")
1482 end 1368 end
1483 for tok in d1:full_name_get():gmatch("[^%.]+") do 1369 for tok in d1:name_get():gmatch("[^%.]+") do
1484 ret[#ret + 1] = tok:lower() 1370 ret[#ret + 1] = tok:lower()
1485 end 1371 end
1486 if tp == reft.FUNC then 1372 if tp == reft.FUNC then
@@ -1524,14 +1410,14 @@ M.parse = function(st)
1524 end 1410 end
1525 -- build reverse inheritance hierarchy 1411 -- build reverse inheritance hierarchy
1526 for cl in eos:classes_get() do 1412 for cl in eos:classes_get() do
1527 local cln = cl:full_name_get() 1413 local cln = cl:name_get()
1528 for icl in cl:inherits_get() do 1414 for icl in cl:inherits_get() do
1529 local t = revh[icl] 1415 local t = revh[icl]
1530 if not t then 1416 if not t then
1531 t = {} 1417 t = {}
1532 revh[icl] = t 1418 revh[icl] = t
1533 end 1419 end
1534 t[#t + 1] = M.Class.by_name_get(cl:full_name_get()) 1420 t[#t + 1] = M.Class.by_name_get(cl:name_get())
1535 end 1421 end
1536 end 1422 end
1537end 1423end
diff --git a/src/scripts/elua/apps/docgen/stats.lua b/src/scripts/elua/apps/docgen/stats.lua
index 5bbc592333..9659f86dcd 100644
--- a/src/scripts/elua/apps/docgen/stats.lua
+++ b/src/scripts/elua/apps/docgen/stats.lua
@@ -119,7 +119,7 @@ M.check_class = function(cl)
119 return 119 return
120 end 120 end
121 if not cl:doc_get():exists() then 121 if not cl:doc_get():exists() then
122 print_missing(cl:full_name_get(), ct) 122 print_missing(cl:name_get(), ct)
123 stat_incr(ct, true) 123 stat_incr(ct, true)
124 else 124 else
125 stat_incr(ct, false) 125 stat_incr(ct, false)
@@ -127,7 +127,7 @@ M.check_class = function(cl)
127 127
128 for i, ev in ipairs(cl:events_get()) do 128 for i, ev in ipairs(cl:events_get()) do
129 if not ev:doc_get():exists() then 129 if not ev:doc_get():exists() then
130 print_missing(cl:full_name_get() .. "." .. ev:name_get(), "event") 130 print_missing(cl:name_get() .. "." .. ev:name_get(), "event")
131 stat_incr("event", true) 131 stat_incr("event", true)
132 else 132 else
133 stat_incr("event", false) 133 stat_incr("event", false)
@@ -136,7 +136,7 @@ M.check_class = function(cl)
136end 136end
137 137
138M.check_method = function(fn, cl) 138M.check_method = function(fn, cl)
139 local fulln = cl:full_name_get() .. "." .. fn:name_get() 139 local fulln = cl:name_get() .. "." .. fn:name_get()
140 if fn:return_type_get(fn.METHOD) then 140 if fn:return_type_get(fn.METHOD) then
141 if not fn:return_doc_get(fn.METHOD):exists() then 141 if not fn:return_doc_get(fn.METHOD):exists() then
142 print_missing(fulln, "method return") 142 print_missing(fulln, "method return")
@@ -168,7 +168,7 @@ M.check_property = function(fn, cl, ft)
168 } 168 }
169 local pfx = pfxs[ft] 169 local pfx = pfxs[ft]
170 170
171 local fulln = cl:full_name_get() .. "." .. fn:name_get() 171 local fulln = cl:name_get() .. "." .. fn:name_get()
172 if fn:return_type_get(ft) then 172 if fn:return_type_get(ft) then
173 if not fn:return_doc_get(ft):exists() then 173 if not fn:return_doc_get(ft):exists() then
174 print_missing(fulln, pfx .. "etter return") 174 print_missing(fulln, pfx .. "etter return")
@@ -208,7 +208,7 @@ end
208 208
209M.check_alias = function(v) 209M.check_alias = function(v)
210 if not v:doc_get():exists() then 210 if not v:doc_get():exists() then
211 print_missing(v:full_name_get(), "alias") 211 print_missing(v:name_get(), "alias")
212 stat_incr("alias", true) 212 stat_incr("alias", true)
213 else 213 else
214 stat_incr("alias", false) 214 stat_incr("alias", false)
@@ -217,14 +217,14 @@ end
217 217
218M.check_struct = function(v) 218M.check_struct = function(v)
219 if not v:doc_get():exists() then 219 if not v:doc_get():exists() then
220 print_missing(v:full_name_get(), "struct") 220 print_missing(v:name_get(), "struct")
221 stat_incr("struct", true) 221 stat_incr("struct", true)
222 else 222 else
223 stat_incr("struct", false) 223 stat_incr("struct", false)
224 end 224 end
225 for i, fl in ipairs(v:struct_fields_get()) do 225 for i, fl in ipairs(v:struct_fields_get()) do
226 if not fl:doc_get():exists() then 226 if not fl:doc_get():exists() then
227 print_missing(v:full_name_get() .. "." .. fl:name_get(), "struct field") 227 print_missing(v:name_get() .. "." .. fl:name_get(), "struct field")
228 stat_incr("sfield", true) 228 stat_incr("sfield", true)
229 else 229 else
230 stat_incr("sfield", false) 230 stat_incr("sfield", false)
@@ -234,14 +234,14 @@ end
234 234
235M.check_enum = function(v) 235M.check_enum = function(v)
236 if not v:doc_get():exists() then 236 if not v:doc_get():exists() then
237 print_missing(v:full_name_get(), "enum") 237 print_missing(v:name_get(), "enum")
238 stat_incr("enum", true) 238 stat_incr("enum", true)
239 else 239 else
240 stat_incr("enum", false) 240 stat_incr("enum", false)
241 end 241 end
242 for i, fl in ipairs(v:enum_fields_get()) do 242 for i, fl in ipairs(v:enum_fields_get()) do
243 if not fl:doc_get():exists() then 243 if not fl:doc_get():exists() then
244 print_missing(v:full_name_get() .. "." .. fl:name_get(), "enum field") 244 print_missing(v:name_get() .. "." .. fl:name_get(), "enum field")
245 stat_incr("efield", true) 245 stat_incr("efield", true)
246 else 246 else
247 stat_incr("efield", false) 247 stat_incr("efield", false)
@@ -251,7 +251,7 @@ end
251 251
252M.check_constant = function(v) 252M.check_constant = function(v)
253 if not v:doc_get():exists() then 253 if not v:doc_get():exists() then
254 print_missing(v:full_name_get(), "constant") 254 print_missing(v:name_get(), "constant")
255 stat_incr("constant", true) 255 stat_incr("constant", true)
256 else 256 else
257 stat_incr("constant", false) 257 stat_incr("constant", false)
@@ -260,7 +260,7 @@ end
260 260
261M.check_global = function(v) 261M.check_global = function(v)
262 if not v:doc_get():exists() then 262 if not v:doc_get():exists() then
263 print_missing(v:full_name_get(), "global") 263 print_missing(v:name_get(), "global")
264 stat_incr("global", true) 264 stat_incr("global", true)
265 else 265 else
266 stat_incr("global", false) 266 stat_incr("global", false)
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 3ae12e1191..6e81595556 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -342,7 +342,7 @@ local build_reftable = function(f, title, ctype, t, iscl)
342 writer.Buffer():write_link( 342 writer.Buffer():write_link(
343 iscl and v:nspaces_get(true) 343 iscl and v:nspaces_get(true)
344 or dtree.Node.nspaces_get(v, true), 344 or dtree.Node.nspaces_get(v, true),
345 v:full_name_get() 345 v:name_get()
346 ):finish(), 346 ):finish(),
347 v:doc_get():brief_get() 347 v:doc_get():brief_get()
348 } 348 }
@@ -428,7 +428,7 @@ build_inherits = function(cl, t, lvl)
428 lvl = lvl or 0 428 lvl = lvl or 0
429 local lbuf = writer.Buffer() 429 local lbuf = writer.Buffer()
430 if lvl > 0 then 430 if lvl > 0 then
431 lbuf:write_link(cl:nspaces_get(true), cl:full_name_get()) 431 lbuf:write_link(cl:nspaces_get(true), cl:name_get())
432 lbuf:write_raw(" ") 432 lbuf:write_raw(" ")
433 lbuf:write_i("(" .. cl:type_str_get() .. ")") 433 lbuf:write_i("(" .. cl:type_str_get() .. ")")
434 434
@@ -446,7 +446,7 @@ build_inherit_summary = function(cl, buf)
446 buf = buf or writer.Buffer() 446 buf = buf or writer.Buffer()
447 buf:write_raw(" => ") 447 buf:write_raw(" => ")
448 448
449 buf:write_link(cl:nspaces_get(true), cl:full_name_get()) 449 buf:write_link(cl:nspaces_get(true), cl:name_get())
450 buf:write_raw(" ") 450 buf:write_raw(" ")
451 buf:write_i("(" .. cl:type_str_get() .. ")") 451 buf:write_i("(" .. cl:type_str_get() .. ")")
452 452
@@ -671,7 +671,7 @@ local find_parent_impl
671find_parent_impl = function(fulln, cl) 671find_parent_impl = function(fulln, cl)
672 for i, pcl in ipairs(cl:inherits_get()) do 672 for i, pcl in ipairs(cl:inherits_get()) do
673 for j, impl in ipairs(pcl:implements_get()) do 673 for j, impl in ipairs(pcl:implements_get()) do
674 if impl:full_name_get() == fulln then 674 if impl:name_get() == fulln then
675 return impl, pcl 675 return impl, pcl
676 end 676 end
677 end 677 end
@@ -734,7 +734,7 @@ local build_functable = function(f, tcl, tbl)
734 table.sort(nt, function(v1, v2) 734 table.sort(nt, function(v1, v2)
735 local cl1, cl2 = v1[0], v2[0] 735 local cl1, cl2 = v1[0], v2[0]
736 if cl1 ~= cl2 then 736 if cl1 ~= cl2 then
737 return cl1:full_name_get() < cl2:full_name_get() 737 return cl1:name_get() < cl2:name_get()
738 end 738 end
739 739
740 local f1, f2 = v1[1], v2[1] 740 local f1, f2 = v1[1], v2[1]
@@ -761,7 +761,7 @@ local write_description = function(f, impl, func, cl)
761 local doc = impl:doc_get(func.METHOD, true) 761 local doc = impl:doc_get(func.METHOD, true)
762 local docf = impl:fallback_doc_get(true) 762 local docf = impl:fallback_doc_get(true)
763 if over and (not doc:exists() and (not docf or not docf:exists())) then 763 if over and (not doc:exists() and (not docf or not docf:exists())) then
764 bdoc = find_parent_briefdoc(impl:full_name_get(), cl) 764 bdoc = find_parent_briefdoc(impl:name_get(), cl)
765 else 765 else
766 bdoc = doc:brief_get(docf) 766 bdoc = doc:brief_get(docf)
767 end 767 end
@@ -847,7 +847,7 @@ local write_functable = function(f, tcl, tbl)
847 -- but we get latest doc every time so it's ok for now 847 -- but we get latest doc every time so it's ok for now
848 local llbuf = writer.Buffer() 848 local llbuf = writer.Buffer()
849 llbuf:write_raw(" [Overridden from ") 849 llbuf:write_raw(" [Overridden from ")
850 llbuf:write_link(ocl:nspaces_get(true), ocl:full_name_get()) 850 llbuf:write_link(ocl:nspaces_get(true), ocl:name_get())
851 llbuf:write_raw("]") 851 llbuf:write_raw("]")
852 f:write_i(llbuf:finish()) 852 f:write_i(llbuf:finish())
853 end 853 end
@@ -899,7 +899,7 @@ local write_inherit_functable = function(f, tcl, tbl)
899 if cl ~= prevcl then 899 if cl ~= prevcl then
900 prevcl = cl 900 prevcl = cl
901 f:write_raw("^ ") 901 f:write_raw("^ ")
902 f:write_link(cl:nspaces_get(true), cl:full_name_get()) 902 f:write_link(cl:nspaces_get(true), cl:name_get())
903 f:write_raw(" ^^^") 903 f:write_raw(" ^^^")
904 f:write_nl() 904 f:write_nl()
905 end 905 end
@@ -984,7 +984,7 @@ local build_evtable = function(f, tcl, tbl, newm)
984 984
985 table.sort(nt, function(v1, v2) 985 table.sort(nt, function(v1, v2)
986 if v1[0] ~= v2[0] then 986 if v1[0] ~= v2[0] then
987 return v1[0]:full_name_get() < v2[0]:full_name_get() 987 return v1[0]:name_get() < v2[0]:name_get()
988 end 988 end
989 989
990 return v1[2] < v2[2] 990 return v1[2] < v2[2]
@@ -1053,7 +1053,7 @@ local write_inherit_evtable = function(f, tcl, tbl)
1053 if cl ~= prevcl then 1053 if cl ~= prevcl then
1054 prevcl = cl 1054 prevcl = cl
1055 f:write_raw("^ ") 1055 f:write_raw("^ ")
1056 f:write_link(cl:nspaces_get(true), cl:full_name_get()) 1056 f:write_link(cl:nspaces_get(true), cl:name_get())
1057 f:write_raw(" ^^^") 1057 f:write_raw(" ^^^")
1058 f:write_nl() 1058 f:write_nl()
1059 end 1059 end
@@ -1080,11 +1080,11 @@ end
1080 1080
1081local build_class = function(cl) 1081local build_class = function(cl)
1082 local cln = cl:nspaces_get() 1082 local cln = cl:nspaces_get()
1083 local fulln = cl:full_name_get() 1083 local fulln = cl:name_get()
1084 local f = writer.Writer(cln, fulln) 1084 local f = writer.Writer(cln, fulln)
1085 printgen("Generating class: " .. fulln) 1085 printgen("Generating class: " .. fulln)
1086 1086
1087 f:write_h(cl:full_name_get() .. " (" .. cl:type_str_get() .. ")", 1) 1087 f:write_h(cl:name_get() .. " (" .. cl:type_str_get() .. ")", 1)
1088 1088
1089 f:write_h("Description", 2) 1089 f:write_h("Description", 2)
1090 f:write_raw(cl:doc_get():full_get(nil, true)) 1090 f:write_raw(cl:doc_get():full_get(nil, true))
@@ -1151,7 +1151,7 @@ end
1151 1151
1152local build_alias = function(tp) 1152local build_alias = function(tp)
1153 local ns = dtree.Node.nspaces_get(tp) 1153 local ns = dtree.Node.nspaces_get(tp)
1154 local fulln = tp:full_name_get() 1154 local fulln = tp:name_get()
1155 local f = writer.Writer(ns, fulln) 1155 local f = writer.Writer(ns, fulln)
1156 printgen("Generating alias: " .. fulln) 1156 printgen("Generating alias: " .. fulln)
1157 1157
@@ -1169,7 +1169,7 @@ end
1169 1169
1170local build_struct = function(tp) 1170local build_struct = function(tp)
1171 local ns = dtree.Node.nspaces_get(tp) 1171 local ns = dtree.Node.nspaces_get(tp)
1172 local fulln = tp:full_name_get() 1172 local fulln = tp:name_get()
1173 local f = writer.Writer(ns, fulln) 1173 local f = writer.Writer(ns, fulln)
1174 printgen("Generating struct: " .. fulln) 1174 printgen("Generating struct: " .. fulln)
1175 1175
@@ -1202,7 +1202,7 @@ end
1202 1202
1203local build_enum = function(tp) 1203local build_enum = function(tp)
1204 local ns = dtree.Node.nspaces_get(tp) 1204 local ns = dtree.Node.nspaces_get(tp)
1205 local fulln = tp:full_name_get() 1205 local fulln = tp:name_get()
1206 local f = writer.Writer(ns, fulln) 1206 local f = writer.Writer(ns, fulln)
1207 printgen("Generating enum: " .. fulln) 1207 printgen("Generating enum: " .. fulln)
1208 1208
@@ -1235,7 +1235,7 @@ end
1235 1235
1236local build_variable = function(v, constant) 1236local build_variable = function(v, constant)
1237 local ns = v:nspaces_get() 1237 local ns = v:nspaces_get()
1238 local fulln = v:full_name_get() 1238 local fulln = v:name_get()
1239 local f = writer.Writer(ns, fulln) 1239 local f = writer.Writer(ns, fulln)
1240 printgen("Generating variable: " .. fulln) 1240 printgen("Generating variable: " .. fulln)
1241 1241
@@ -1337,9 +1337,9 @@ local write_inherited_from = function(f, impl, cl, over, prop)
1337 end 1337 end
1338 local buf = writer.Buffer() 1338 local buf = writer.Buffer()
1339 buf:write_raw("Overridden from ") 1339 buf:write_raw("Overridden from ")
1340 local pimpl, pcl = find_parent_impl(impl:full_name_get(), cl) 1340 local pimpl, pcl = find_parent_impl(impl:name_get(), cl)
1341 buf:write_link( 1341 buf:write_link(
1342 impl:function_get():nspaces_get(pcl, true), impl:full_name_get() 1342 impl:function_get():nspaces_get(pcl, true), impl:name_get()
1343 ) 1343 )
1344 if prop then 1344 if prop then
1345 buf:write_raw(" ") 1345 buf:write_raw(" ")
@@ -1365,7 +1365,7 @@ local impls_of = {}
1365 1365
1366local get_all_impls_of 1366local get_all_impls_of
1367get_all_impls_of = function(tbl, cl, fn, got) 1367get_all_impls_of = function(tbl, cl, fn, got)
1368 local cfn = cl:full_name_get() 1368 local cfn = cl:name_get()
1369 if got[cfn] then 1369 if got[cfn] then
1370 return 1370 return
1371 end 1371 end
@@ -1386,7 +1386,7 @@ local write_ilist = function(f, impl, cl)
1386 local fn = impl:function_get() 1386 local fn = impl:function_get()
1387 local fnn = fn:name_get() 1387 local fnn = fn:name_get()
1388 local ocl = fn:implement_get():class_get() 1388 local ocl = fn:implement_get():class_get()
1389 local onm = ocl:full_name_get() .. "." .. fnn 1389 local onm = ocl:name_get() .. "." .. fnn
1390 local imps = impls_of[onm] 1390 local imps = impls_of[onm]
1391 if not imps then 1391 if not imps then
1392 imps = {} 1392 imps = {}
@@ -1398,7 +1398,7 @@ local write_ilist = function(f, impl, cl)
1398 local t = {} 1398 local t = {}
1399 for i, icl in ipairs(imps) do 1399 for i, icl in ipairs(imps) do
1400 local buf = writer.Buffer() 1400 local buf = writer.Buffer()
1401 local cfn = icl:full_name_get() .. "." .. fnn 1401 local cfn = icl:name_get() .. "." .. fnn
1402 if icl:is_same(cl) then 1402 if icl:is_same(cl) then
1403 buf:write_b(cfn) 1403 buf:write_b(cfn)
1404 else 1404 else
@@ -1413,13 +1413,13 @@ build_method = function(impl, cl)
1413 local over = impl:is_overridden(cl) 1413 local over = impl:is_overridden(cl)
1414 local fn = impl:function_get() 1414 local fn = impl:function_get()
1415 local mns = fn:nspaces_get(cl) 1415 local mns = fn:nspaces_get(cl)
1416 local methn = cl:full_name_get() .. "." .. fn:name_get() 1416 local methn = cl:name_get() .. "." .. fn:name_get()
1417 local f = writer.Writer(mns, methn) 1417 local f = writer.Writer(mns, methn)
1418 printgen("Generating method: " .. methn) 1418 printgen("Generating method: " .. methn)
1419 1419
1420 local doc = impl:doc_get(fn.METHOD) 1420 local doc = impl:doc_get(fn.METHOD)
1421 if over and not doc:exists() then 1421 if over and not doc:exists() then
1422 doc = find_parent_doc(impl:full_name_get(), cl, fn.METHOD) 1422 doc = find_parent_doc(impl:name_get(), cl, fn.METHOD)
1423 end 1423 end
1424 1424
1425 f:write_h("Description", 2) 1425 f:write_h("Description", 2)
@@ -1456,7 +1456,7 @@ build_property = function(impl, cl)
1456 local over = impl:is_overridden(cl) 1456 local over = impl:is_overridden(cl)
1457 local fn = impl:function_get() 1457 local fn = impl:function_get()
1458 local pns = fn:nspaces_get(cl) 1458 local pns = fn:nspaces_get(cl)
1459 local propn = cl:full_name_get() .. "." .. fn:name_get() 1459 local propn = cl:name_get() .. "." .. fn:name_get()
1460 local f = writer.Writer(pns, propn) 1460 local f = writer.Writer(pns, propn)
1461 printgen("Generating property: " .. propn) 1461 printgen("Generating property: " .. propn)
1462 1462
@@ -1471,13 +1471,13 @@ build_property = function(impl, cl)
1471 1471
1472 if over then 1472 if over then
1473 if not doc:exists() then 1473 if not doc:exists() then
1474 doc = find_parent_doc(impl:full_name_get(), cl, fn.PROPERTY) 1474 doc = find_parent_doc(impl:name_get(), cl, fn.PROPERTY)
1475 end 1475 end
1476 if isget and not gdoc:exists() then 1476 if isget and not gdoc:exists() then
1477 gdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_GET) 1477 gdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_GET)
1478 end 1478 end
1479 if isset and not sdoc:exists() then 1479 if isset and not sdoc:exists() then
1480 sdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_SET) 1480 sdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_SET)
1481 end 1481 end
1482 end 1482 end
1483 1483
@@ -1592,7 +1592,7 @@ end
1592 1592
1593build_event = function(ev, cl) 1593build_event = function(ev, cl)
1594 local evn = ev:nspaces_get(cl) 1594 local evn = ev:nspaces_get(cl)
1595 local evnm = cl:full_name_get() .. ": " .. ev:name_get() 1595 local evnm = cl:name_get() .. ": " .. ev:name_get()
1596 local f = writer.Writer(evn, evnm) 1596 local f = writer.Writer(evn, evnm)
1597 printgen("Generating event: " .. evnm) 1597 printgen("Generating event: " .. evnm)
1598 1598
@@ -1646,7 +1646,7 @@ end
1646local build_stats_keyref = function() 1646local build_stats_keyref = function()
1647 for i, cl in ipairs(dtree.Class.all_get()) do 1647 for i, cl in ipairs(dtree.Class.all_get()) do
1648 stats.check_class(cl) 1648 stats.check_class(cl)
1649 keyref.add(cl:full_name_get():gsub("%.", "_"), cl:nspaces_get(), "c") 1649 keyref.add(cl:name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
1650 for i, imp in ipairs(cl:implements_get()) do 1650 for i, imp in ipairs(cl:implements_get()) do
1651 -- TODO: handle doc overrides in stats system 1651 -- TODO: handle doc overrides in stats system
1652 if not imp:is_overridden(cl) then 1652 if not imp:is_overridden(cl) then
@@ -1753,7 +1753,7 @@ getopt.parse {
1753 1753
1754 if st == "clist" then 1754 if st == "clist" then
1755 for i, cl in ipairs(dtree.Class.all_get()) do 1755 for i, cl in ipairs(dtree.Class.all_get()) do
1756 print(cl:full_name_get()) 1756 print(cl:name_get())
1757 end 1757 end
1758 return 1758 return
1759 end 1759 end
diff --git a/src/scripts/elua/modules/lualian.lua b/src/scripts/elua/modules/lualian.lua
index 959b4fd837..e515aaf8bc 100644
--- a/src/scripts/elua/modules/lualian.lua
+++ b/src/scripts/elua/modules/lualian.lua
@@ -107,7 +107,7 @@ local typeconv = function(tps, expr, isin)
107 return build_calln(tps, expr, isin) 107 return build_calln(tps, expr, isin)
108 end 108 end
109 109
110 local tp = tps:name_get() 110 local tp = tps:short_name_get()
111 111
112 if is_num(tp) then 112 if is_num(tp) then
113 return isin and expr or ("tonumber(%s)"):format(expr) 113 return isin and expr or ("tonumber(%s)"):format(expr)
@@ -407,7 +407,7 @@ local Mixin = Node:clone {
407 407
408 generate = function(self, s) 408 generate = function(self, s)
409 dom:log(log.level.INFO, " Generating for interface/mixin: " 409 dom:log(log.level.INFO, " Generating for interface/mixin: "
410 .. self.klass:full_name_get()) 410 .. self.klass:name_get())
411 411
412 s:write("ffi.cdef [[\n") 412 s:write("ffi.cdef [[\n")
413 self:gen_ffi(s) 413 self:gen_ffi(s)
@@ -419,7 +419,7 @@ local Mixin = Node:clone {
419 self:gen_children(s) 419 self:gen_children(s)
420 s:write("}\n") 420 s:write("}\n")
421 421
422 local knu = self.klass:full_name_get():gsub("%.", "_") 422 local knu = self.klass:name_get():gsub("%.", "_")
423 if not self.iface then 423 if not self.iface then
424 s:write(("__body[\"__mixin_%s\"] = true\n"):format(knu)) 424 s:write(("__body[\"__mixin_%s\"] = true\n"):format(knu))
425 else 425 else
@@ -462,7 +462,7 @@ local Class = Node:clone {
462 462
463 generate = function(self, s) 463 generate = function(self, s)
464 dom:log(log.level.INFO, " Generating for class: " 464 dom:log(log.level.INFO, " Generating for class: "
465 .. self.klass:full_name_get()) 465 .. self.klass:name_get())
466 466
467 s:write("ffi.cdef [[\n") 467 s:write("ffi.cdef [[\n")
468 self:gen_ffi(s) 468 self:gen_ffi(s)
@@ -482,7 +482,7 @@ local Class = Node:clone {
482 return eo.__ctor_common(__class, parent, eo.class_get("%s").__eo_ctor, 482 return eo.__ctor_common(__class, parent, eo.class_get("%s").__eo_ctor,
483 1, ...) 483 1, ...)
484end 484end
485]]):format(mname, self.klass:name_get(), self.klass:full_name_get():gsub("%.", 485]]):format(mname, self.klass:short_name_get(), self.klass:name_get():gsub("%.",
486 "_"))) 486 "_")))
487 end, 487 end,
488 488
@@ -572,7 +572,7 @@ local File = Node:clone {
572 local kls = self.klass 572 local kls = self.klass
573 local ckls = self.children[1] 573 local ckls = self.children[1]
574 574
575 local kn = kls:full_name_get() 575 local kn = kls:name_get()
576 576
577 dom:log(log.level.INFO, "Generating for file: " .. self.fname) 577 dom:log(log.level.INFO, "Generating for file: " .. self.fname)
578 dom:log(log.level.INFO, " Class : " .. kn) 578 dom:log(log.level.INFO, " Class : " .. kn)
@@ -669,7 +669,7 @@ end
669local gen_class = function(klass) 669local gen_class = function(klass)
670 local tp = klass:type_get() 670 local tp = klass:type_get()
671 if tp == class_type.UNKNOWN then 671 if tp == class_type.UNKNOWN then
672 error(klass:full_name_get() .. ": unknown type") 672 error(klass:name_get() .. ": unknown type")
673 elseif tp == class_type.MIXIN or tp == class_type.INTERFACE then 673 elseif tp == class_type.MIXIN or tp == class_type.INTERFACE then
674 return Mixin(tp == class_type.INTERFACE, klass, gen_contents(klass)) 674 return Mixin(tp == class_type.INTERFACE, klass, gen_contents(klass))
675 end 675 end
@@ -684,7 +684,7 @@ local gen_class = function(klass)
684 elseif tp == class_type.INTERFACE or tp == class_type.MIXIN then 684 elseif tp == class_type.INTERFACE or tp == class_type.MIXIN then
685 mixins[#mixins + 1] = v 685 mixins[#mixins + 1] = v
686 else 686 else
687 error(klass:full_name_get() .. ": unknown inherit " .. v) 687 error(klass:name_get() .. ": unknown inherit " .. v)
688 end 688 end
689 end 689 end
690 return Class(klass, parents, mixins, gen_contents(klass)) 690 return Class(klass, parents, mixins, gen_contents(klass))