Debian Codegraph @

src/scripts/ckdoc/test-class.ck

raw
1 public class Foo
2 {
3 /** a is an integer; nothing uses this. */
4 int a;
5 /** b is a float; nothing uses this either. */
6 float b;
7 /** a number, type integer */
8 1 => int num;
9
10 /** constructor "default" */
11 fun @construct() { 2 => num; }
12
13 /** another constructor */
14 fun @construct( int x ) { x => num; }
15
16 /** yet another constructor */
17 fun @construct( int x, int y ) { x*y => num; }
18
19 /** alternate way of define a constructor */
20 fun void Foo( int x, int y, int z ) { x*y*z => num; }
21
22 /** this function does nothing. */
23 fun void bar( int x )
24 {
25 // \o/ this function does nothing" \o/
26 // => this function does nothing" <=
27 //=> this function does nothing
28 /*=> */
29 }
30
31 /** destructor */
32 fun @destruct() { <<< "destructor:", this.num >>>; }
33 }
34
35 // get Type
36 [ Foo.typeOf() ] @=> Type types[];
37 // doc generator
38 CKDoc doc;
39 // add group
40 doc.addGroup( types, "my classes!", "my", "Will this work?" );
41 // generate
42 doc.outputToDir( ".", "My Class Library" );