Fix for UBSan build
[platform/upstream/doxygen.git] / examples / tclexample.tcl
1 ## \file tclexample.tcl
2 # File documentation.
3 #\verbatim
4
5 # Startup code:\
6 exec tclsh "$0" "$@"
7 #\endverbatim
8 ## Documented namespace \c ns .
9 # The code is inserted here:
10 #\code
11 namespace eval ns {
12   ## Documented proc \c ns_proc .
13   # param[in] arg some argument
14   proc ns_proc {arg} {}
15   ## Documented var \c ns_var .
16   # Some documentation.
17   variable ns_var
18   ## Documented itcl class \c itcl_class .
19   itcl::class itcl_class {
20     ## Create object.
21     constructor {args} {eval $args}
22     ## Destroy object.
23     destructor {exit}
24     ## Documented itcl method \c itcl_method_x .
25     # param[in] arg Argument
26     private method itcl_method_x {arg}
27     ## Documented itcl method \c itcl_method_y .
28     # param[in] arg Argument
29     protected method itcl_method_y {arg} {}
30     ## Documented itcl method \c itcl_method_z .
31     # param[in] arg Argument
32     public method itcl_method_z {arg} {}
33     ## Documented common itcl var \c itcl_Var .
34     common itcl_Var
35     ## \protectedsection
36     
37     variable itcl_var1;#< Documented itcl var \c itcl_var1 .
38     variable itcl_var2;#< Documented itcl var \c itcl_var2 .
39   }
40   ## Documented oo class \c oo_class .
41   oo::class create oo_class {
42     ## Create object.
43     # Configure with args
44     constructor {args} {eval $args}
45     ## Destroy object.
46     # Exit.
47     destructor {exit}
48     ## Documented oo var \c oo_var .
49     # Defined inside class
50     variable oo_var
51     ## \private Documented oo method \c oo_method_x .
52     # param[in] arg Argument
53     method oo_method_x {arg} {}
54     ## \protected Documented oo method \c oo_method_y .
55     # param[in] arg Argument
56     method oo_method_y {arg} {}
57     ## \public Documented oo method \c oo_method_z .
58     # param[in] arg Argument
59     method oo_method_z {arg} {}
60   }
61 }
62 #\endcode
63
64 itcl::body ::ns::itcl_class::itcl_method_x {argx} {
65   puts "$argx OK"
66 }
67
68 oo::define ns::oo_class {
69   ## \public Outside defined variable \c oo_var_out .
70   # Inside oo_class
71   variable oo_var_out
72 }
73
74 ## Documented global proc \c glob_proc .
75 # param[in] arg Argument
76 proc glob_proc {arg} {puts $arg}
77
78 variable glob_var;#< Documented global var \c glob_var\
79   with newline
80 #< and continued line
81
82 # end of file