<Comment>// Vala Sample File</Comment><br/>
<Normal Text></Normal Text><br/>
<Comment>/*</Comment><br/>
<Comment> * Multiline comment</Comment><br/>
<Comment> * </Comment><Alert Level 3>NOTE</Alert Level 3><Comment> </Comment><Alert Level 2>FIXME</Alert Level 2><Comment> </Comment><Alert Level 1>ALERT</Alert Level 1><br/>
<Comment> */</Comment><br/>
<Data Type>void</Data Type><Normal Text> main</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    print</Normal Text><Symbol>(</Symbol><String>"Hello World</String><String Char>\n</String Char><String>"</String><Symbol>);</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Example 1</Comment><br/>
<Keyword>class</Keyword><Normal Text> Sample</Normal Text><Symbol>:</Symbol><Normal Text> Object </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Data Type>void</Data Type><Normal Text> greeting</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        stdout</Normal Text><Symbol>.</Symbol><Normal Text>printf</Normal Text><Symbol>(</Symbol><String>"Hello World</String><String Char>\n</String Char><String>"</String><Symbol>);</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>static</Keyword><Normal Text> </Normal Text><Data Type>void</Data Type><Normal Text> main</Normal Text><Symbol>(</Symbol><Data Type>string</Data Type><Symbol>[]</Symbol><Normal Text> args</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Data Type>var</Data Type><Normal Text> sample </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>new</Keyword><Normal Text> Sample</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>        sample</Normal Text><Symbol>.</Symbol><Normal Text>greeting</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Example 2</Comment><br/>
<Keyword>using</Keyword><Normal Text> GLib</Normal Text><Symbol>;</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>interface</Keyword><Normal Text> Printable </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>abstract</Keyword><Normal Text> </Normal Text><Data Type>string</Data Type><Normal Text> print</Normal Text><Symbol>();</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>virtual</Keyword><Normal Text> </Normal Text><Data Type>string</Data Type><Normal Text> pretty_print</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><String>"Please "</String><Normal Text> </Normal Text><Symbol>+</Symbol><Normal Text> print</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>class</Keyword><Normal Text> NormalPrint</Normal Text><Symbol>:</Symbol><Normal Text> Object</Normal Text><Symbol>,</Symbol><Normal Text> Printable </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Data Type>string</Data Type><Normal Text> print</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><String>"don't forget about me"</String><Symbol>;</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>class</Keyword><Normal Text> OverridePrint</Normal Text><Symbol>:</Symbol><Normal Text> Object</Normal Text><Symbol>,</Symbol><Normal Text> Printable </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Data Type>string</Data Type><Normal Text> print</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><String>"Mind the gap"</String><Symbol>;</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>public</Keyword><Normal Text> </Normal Text><Keyword>override</Keyword><Normal Text> </Normal Text><Data Type>string</Data Type><Normal Text> pretty_print</Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>        </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><String>"Override"</String><Symbol>;</Symbol><br/>
<Normal Text>    </Normal Text><Symbol>}</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Data Type>void</Data Type><Normal Text> main</Normal Text><Symbol>(</Symbol><Data Type>string</Data Type><Symbol>[]</Symbol><Normal Text> args</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    </Normal Text><Data Type>var</Data Type><Normal Text> normal </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>new</Keyword><Normal Text> NormalPrint</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>    </Normal Text><Data Type>var</Data Type><Normal Text> overridden </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>new</Keyword><Normal Text> OverridePrint</Normal Text><Symbol>();</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    print</Normal Text><Symbol>(</Symbol><Normal Text>normal</Normal Text><Symbol>.</Symbol><Normal Text>pretty_print</Normal Text><Symbol>());</Symbol><br/>
<Normal Text>    print</Normal Text><Symbol>(</Symbol><Normal Text>overridden</Normal Text><Symbol>.</Symbol><Normal Text>pretty_print</Normal Text><Symbol>());</Symbol><br/>
<Symbol>}</Symbol><br/>
<Normal Text></Normal Text><br/>
<Comment>// Example 3</Comment><br/>
<Keyword>using</Keyword><Normal Text> Gtk</Normal Text><Symbol>;</Symbol><br/>
<Normal Text></Normal Text><br/>
<Data Type>int</Data Type><Normal Text> main</Normal Text><Symbol>(</Symbol><Data Type>string</Data Type><Symbol>[]</Symbol><Normal Text> args</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>{</Symbol><br/>
<Normal Text>    Gtk</Normal Text><Symbol>.</Symbol><Normal Text>init</Normal Text><Symbol>(</Symbol><Keyword>ref</Keyword><Normal Text> args</Normal Text><Symbol>);</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Data Type>var</Data Type><Normal Text> window </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>new</Keyword><Normal Text> Window</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>title </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><String>"Hello, World!"</String><Symbol>;</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>border_width </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Decimal>10</Decimal><Symbol>;</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>window_position </Normal Text><Symbol>=</Symbol><Normal Text> WindowPosition</Normal Text><Symbol>.</Symbol><Normal Text>CENTER</Normal Text><Symbol>;</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>set_default_size</Normal Text><Symbol>(</Symbol><Decimal>350</Decimal><Symbol>,</Symbol><Normal Text> </Normal Text><Decimal>70</Decimal><Symbol>);</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>destroy</Normal Text><Symbol>.</Symbol><Extensions>connect</Extensions><Symbol>(</Symbol><Normal Text>Gtk</Normal Text><Symbol>.</Symbol><Normal Text>main_quit</Normal Text><Symbol>);</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Data Type>var</Data Type><Normal Text> label </Normal Text><Symbol>=</Symbol><Normal Text> </Normal Text><Keyword>new</Keyword><Normal Text> Label</Normal Text><Symbol>(</Symbol><String>"Hello, World!"</String><Symbol>);</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>add</Normal Text><Symbol>(</Symbol><Normal Text>label</Normal Text><Symbol>);</Symbol><br/>
<Normal Text>    window</Normal Text><Symbol>.</Symbol><Normal Text>show_all</Normal Text><Symbol>();</Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    Gtk</Normal Text><Symbol>.</Symbol><Normal Text>main</Normal Text><Symbol>();</Symbol><br/>
<Normal Text>    </Normal Text><Keyword>return</Keyword><Normal Text> </Normal Text><Decimal>0</Decimal><Symbol>;</Symbol><br/>
<Symbol>}</Symbol><br/>
