6 class TypeTestDepthNotGenerator
11 res
.add
"new {classes.last}[Root]"
12 for c
in classes
.skip_tail
(1) do
13 res
.add
"new {c}[Root]"
19 return "not a isa {classes.last}[Root]"
22 redef fun initjava
(res
, interfaces
)
26 if interfaces
then tagc
= "X"
27 res
.add
"new {tagc}{classes.last}<Root>()"
28 for c
in classes
.skip_tail
(1) do
29 res
.add
"new {tagc}{c}<Root>()"
33 redef fun testjava
(interfaces
)
35 return "!(a instanceof {classes.last})"
38 redef fun initcsharp
(res
, interfaces
)
41 if interfaces
then tagc
= "X"
42 res
.add
"new {tagc}{classes.last}<Root>()"
43 for c
in classes
.skip_tail
(1) do
44 res
.add
"new {tagc}{c}<Root>()"
48 redef fun testcsharp
(interfaces
)
50 return "!(a is {classes.last}<Root>)"
53 redef fun initscala
(res
, interfaces
)
56 if interfaces
then tagc
= "X"
57 res
.add
"new {tagc}{classes.last}[Root]()"
58 for c
in classes
.skip_tail
(1) do
59 res
.add
"new {tagc}{c}[Root]()"
63 redef fun testscala
(interfaces
)
65 return "!a.isInstanceOf[{classes.last}[Root]]"
68 redef fun initcpp
(res
)
70 res
.add
"new {classes.last}<Root>()"
71 for c
in classes
.skip_tail
(1) do
72 res
.add
"new {c}<Root>()"
78 write
"\t\t\t{classes.last}<Root> *to = dynamic_cast<{classes.last}<Root>*>(a);"
82 redef fun inite
(res
, se
)
84 res
.add
"create \{{classes.last}[ROOT]\} a"
85 for c
in classes
.skip_tail
(1) do
86 res
.add
"create \{{c}[ROOT]\} a"
92 write
"\t\t\t\t\tto ?= a"
98 write
"\t\t\tto: {classes.last}[ROOT]"
102 var g
= new TypeTestDepthNotGenerator