summaryrefslogtreecommitdiff
path: root/doc/manual
diff options
context:
space:
mode:
authorAlistair Thomas <astavale@yahoo.co.uk>2017-02-22 19:12:54 +0000
committerAlistair Thomas <astavale@yahoo.co.uk>2017-02-22 19:28:37 +0000
commit9968c5efcb9941425cdaa0bcb31ef6048045685d (patch)
tree5bb910e0776b2d962565357065da0259b26176e6 /doc/manual
parent27894841369a7aa8ab036f56fc73c9a55c9861ad (diff)
downloadvala-9968c5efcb9941425cdaa0bcb31ef6048045685d.tar.gz
doc: Rename doc/vala to doc/manual
Clarify contents of directory with new name
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/.gitignore2
-rw-r--r--doc/manual/Makefile.am69
-rw-r--r--doc/manual/attributes.xml6
-rw-r--r--doc/manual/classes.xml86
-rw-r--r--doc/manual/default.css76
-rw-r--r--doc/manual/delegates.xml13
-rw-r--r--doc/manual/devhelp.xsl18
-rw-r--r--doc/manual/enums.xml25
-rw-r--r--doc/manual/exceptions.xml9
-rw-r--r--doc/manual/expressions.xml108
-rw-r--r--doc/manual/index.xml23
-rw-r--r--doc/manual/interfaces.xml41
-rw-r--r--doc/manual/methods.xml43
-rw-r--r--doc/manual/namespaces.xml30
-rw-r--r--doc/manual/overview.xml30
-rw-r--r--doc/manual/statements.xml102
-rw-r--r--doc/manual/structs.xml36
-rw-r--r--doc/manual/types.xml166
-rw-r--r--doc/manual/xhtml.xsl107
19 files changed, 990 insertions, 0 deletions
diff --git a/doc/manual/.gitignore b/doc/manual/.gitignore
new file mode 100644
index 000000000..cccbd853e
--- /dev/null
+++ b/doc/manual/.gitignore
@@ -0,0 +1,2 @@
+*.html
+vala*.devhelp2
diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am
new file mode 100644
index 000000000..c980cf6a0
--- /dev/null
+++ b/doc/manual/Makefile.am
@@ -0,0 +1,69 @@
+NULL =
+
+book_name=vala@PACKAGE_SUFFIX@
+
+bookdir=$(datadir)/devhelp/books/$(book_name)
+
+chapter_data = \
+ overview.html \
+ types.html \
+ expressions.html \
+ statements.html \
+ namespaces.html \
+ methods.html \
+ classes.html \
+ structs.html \
+ interfaces.html \
+ enums.html \
+ delegates.html \
+ exceptions.html \
+ attributes.html \
+ $(NULL)
+
+built_data = \
+ index.html \
+ $(chapter_data) \
+ $(book_name).devhelp2 \
+ $(NULL)
+
+if HAVE_XSLTPROC
+book_DATA = \
+ $(built_data) \
+ default.css \
+ $(NULL)
+endif
+
+index.html: $(book_sources) xhtml.xsl
+ $(AM_V_GEN)$(XSLTPROC) --xinclude $(srcdir)/xhtml.xsl $(srcdir)/index.xml > index.html
+
+$(chapter_data): index.html
+
+$(book_name).devhelp2: $(book_sources) devhelp.xsl
+ $(AM_V_GEN)$(XSLTPROC) --xinclude $(srcdir)/devhelp.xsl $(srcdir)/index.xml > $(book_name).devhelp2
+
+book_sources = \
+ index.xml \
+ overview.xml \
+ types.xml \
+ expressions.xml \
+ statements.xml \
+ namespaces.xml \
+ methods.xml \
+ classes.xml \
+ structs.xml \
+ interfaces.xml \
+ enums.xml \
+ delegates.xml \
+ exceptions.xml \
+ attributes.xml \
+ $(NULL)
+
+MOSTLYCLEANFILES = $(built_data)
+
+EXTRA_DIST = \
+ $(book_sources) \
+ default.css \
+ xhtml.xsl \
+ devhelp.xsl \
+ $(NULL)
+
diff --git a/doc/manual/attributes.xml b/doc/manual/attributes.xml
new file mode 100644
index 000000000..b0bf6a176
--- /dev/null
+++ b/doc/manual/attributes.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<section id="attributes">
+ <h>Attributes</h>
+ <p>Documentation</p>
+</section>
+
diff --git a/doc/manual/classes.xml b/doc/manual/classes.xml
new file mode 100644
index 000000000..98f8df5fd
--- /dev/null
+++ b/doc/manual/classes.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<section id="classes">
+ <h>Classes</h>
+ <p>A class is a data type that can contain fields, constants, methods, properties, and signals. Class types support inheritance, a mechanism whereby a derived class can extend and specialize a base class.</p>
+ <section id="declaration">
+ <h>Class declarations</h>
+ <p>The simplest class declaration looks like this:</p>
+ <blockcode>
+class ClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ <p>As class types support inheritance, you can specify a base class you want to derive from:</p>
+ <blockcode>
+class ClassName : BaseClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ <div role="note">
+ <h>GObject Note</h>
+ <p>It's recommended that you derive all your classes directly or indirectly from GLib.Object, unless you have a strong reason not to. Some class features are not supported for classes not deriving from GLib.Object.</p>
+ </div>
+ <p>Classes cannot have multiple base classes, however they may implement multiple interfaces:</p>
+ <blockcode>
+class ClassName : BaseClassName, FirstInterfaceName, SecondInterfaceName {
+ &lt;class-member&gt;
+}</blockcode>
+ <p>You may optionally specify an accessibility modifier. Classes support <code>public</code> and <code>private</code> accessibility and default to private if you don't specify one. Public classes may be accessed from outside the library or application they are defined in.</p>
+ <blockcode>
+public class ClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ <p>The <code>abstract</code> modifier may be placed between the optional accessibility modifier and the class name to define an abstract class. An abstract class cannot be instantiated and is used as a base class for derived classes.</p>
+ <blockcode>
+abstract class ClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ <p>The <code>static</code> modifier may be placed between the optional accessibility modifier and the class name to define a static class. A static class cannot be instantiated and may not have a base class. It can also not be used as a base class for derived classes and may only contain static members. Static classes are implicitly abstract, you may not use both modifiers, <code>abstract</code> and <code>static</code>, in the same class declaration.</p>
+ <blockcode>
+static class ClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ <p>You may optionally prefix the class name with a namespace name. This places the class in the specified namespace without the need for a separate namespace declaration.</p>
+ <blockcode>
+class NamespaceName.ClassName {
+ &lt;class-member&gt;
+}</blockcode>
+ </section>
+ <section id="fields">
+ <h>Fields</h>
+ <p>Documentation</p>
+ </section>
+ <section id="methods">
+ <h>Methods</h>
+ <p>Documentation</p>
+ </section>
+ <section id="properties">
+ <h>Properties</h>
+ <blockquote>
+property-declaration:
+ [ access-modifier ] [ member-modifiers ] type identifier <l>{</l> accessor-declarations [ default-value ] <l>}</l> <l>;</l>
+
+accessor-declarations:
+ get-accessor [ set-accessor ]
+ set-accessor [ get-accessor ]
+
+get-accessor:
+ [ access-modifier ] <l>get</l> <l>;</l>
+ [ access-modifier ] <l>get</l> <l>{</l> statement-list <l>}</l>
+
+set-accessor:
+ [ access-modifier ] <l>set</l> [ <l>construct</l> ] <l>;</l>
+ [ access-modifier ] <l>set</l> [ <l>construct</l> ] <l>{</l> statement-list <l>}</l>
+
+default-value:
+ <l>default =</l> expression <l>;</l>
+ </blockquote>
+ </section>
+ <section id="signals">
+ <h>Signals</h>
+ <p>The signal system allows objects to emit signals that can be handled by user-provided signal handlers.</p>
+ <blockquote>
+signal-declaration:
+ [ access-modifier ] <l>signal</l> return-type identifier <l>(</l> [ parameter-list ] <l>)</l> <l>;</l>
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/default.css b/doc/manual/default.css
new file mode 100644
index 000000000..9294f2653
--- /dev/null
+++ b/doc/manual/default.css
@@ -0,0 +1,76 @@
+body {
+ background-color: white;
+ font-family: sans-serif;
+ margin-top: 2.8em;
+}
+
+h1, h2, h3, h4 {
+ color: #005a9c;
+}
+
+a:link, a:visited, a:hover, a:active {
+ color: #005a9c;
+ text-decoration: none;
+}
+
+.toc {
+ font-weight: bold;
+ font-size: larger;
+}
+
+.toc li {
+ list-style-type: none;
+}
+
+.toc li li {
+ font-size: smaller;
+}
+
+h3 a {
+ /* ensure anchors don't vanish below the fixed header */
+ position: relative;
+ top: -2.8em;
+}
+
+.header {
+ background-color: #005a9c;
+ font-weight: bold;
+ padding: .35em;
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 1.4em;
+}
+
+.header a {
+ color: white;
+}
+
+div.note {
+ border: 3px solid #005a9c;
+ padding: 1em;
+ margin: 0 2em 1em 2em;
+}
+
+div.note p, div.note h4 {
+ margin: 0;
+}
+
+pre {
+ background-color: #eee;
+ border: 1px solid black;
+ padding: .5em 1em;
+ margin: 0 2em 1em 2em;
+}
+
+blockquote {
+ font-style: italic;
+ white-space: pre;
+}
+
+blockquote span.literal {
+ font-family: monospace;
+ font-style: normal;
+ font-weight: bold;
+}
diff --git a/doc/manual/delegates.xml b/doc/manual/delegates.xml
new file mode 100644
index 000000000..1eac49664
--- /dev/null
+++ b/doc/manual/delegates.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<section id="delegates">
+ <h>Delegates</h>
+ <section id="declaration">
+ <h>Delegate declarations</h>
+ <p>A delegate represents a callback supplied by the programmer.</p>
+ <blockquote>
+delegate-declaration:
+ [ access-modifier ] <l>delegate</l> return-type qualified-identifier <l>(</l> parameter-list <l>)</l> <l>;</l>
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/devhelp.xsl b/doc/manual/devhelp.xsl
new file mode 100644
index 000000000..735ff18be
--- /dev/null
+++ b/doc/manual/devhelp.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns="http://www.devhelp.net/book" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:template match="/">
+ <book title="{//title/text()}" link="index.html" author="" name="vala" version="2">
+ <chapters>
+ <xsl:for-each select="//body/section">
+ <sub name="{h/text()}" link="{@id}.html">
+ <xsl:for-each select="section">
+ <sub name="{h/text()}" link="{../@id}.html#{@id}"/>
+ </xsl:for-each>
+ </sub>
+ </xsl:for-each>
+ </chapters>
+ </book>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/doc/manual/enums.xml b/doc/manual/enums.xml
new file mode 100644
index 000000000..c58d7a4c9
--- /dev/null
+++ b/doc/manual/enums.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<section id="enums">
+ <h>Enums</h>
+ <p>Enumerated types represent a set of constant values.</p>
+ <section id="declaration">
+ <h>Enum declarations</h>
+ <blockquote>
+enum-declaration:
+ [ access-modifier ] <l>enum</l> qualified-identifier <l>{</l> [ enum-members ] <l>}</l>
+
+enum-members:
+ enum-values [ <l>;</l> [ enum-methods ] ]
+
+enum-values:
+ enum-value [ <l>,</l> enum-values ]
+
+enum-value:
+ identifier [ <l>=</l> expression ]
+
+enum-methods:
+ method-declaration [ enum-methods ]
+</blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/exceptions.xml b/doc/manual/exceptions.xml
new file mode 100644
index 000000000..377bc84d9
--- /dev/null
+++ b/doc/manual/exceptions.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<section id="exceptions">
+ <h>Exceptions</h>
+ <section id="handling">
+ <h>Exception handling</h>
+ <p>Documentation</p>
+ </section>
+</section>
+
diff --git a/doc/manual/expressions.xml b/doc/manual/expressions.xml
new file mode 100644
index 000000000..aaf7725fa
--- /dev/null
+++ b/doc/manual/expressions.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<section id="expressions">
+ <h>Expressions</h>
+ <section id="primary">
+ <h>Primary expressions</h>
+ <blockquote>
+primary-expression:
+ literal
+ simple-name
+ <l>(</l> expression <l>)</l>
+ member-access
+ invocation-expression
+ element-access
+ <l>this</l>
+ <l>base</l>
+ object-creation-expression
+ array-creation-expression
+ <l>sizeof (</l> type <l>)</l>
+ <l>typeof (</l> type <l>)</l>
+ </blockquote>
+ </section>
+ <section id="unary">
+ <h>Unary expressions</h>
+ <blockquote>
+unary-expression:
+ primary-expression
+ <l>+</l> unary-expression
+ <l>-</l> unary-expression
+ <l>!</l> unary-expression
+ <l>~</l> unary-expression
+ cast-expression
+ </blockquote>
+ </section>
+ <section id="arithmetic">
+ <h>Arithmetic operations</h>
+ <blockquote>
+multiplicative-expression:
+ unary-expression
+ multiplicative-expression <l>*</l> unary-expression
+ multiplicative-expression <l>/</l> unary-expression
+ multiplicative-expression <l>%</l> unary-expression
+
+additive-expression:
+ multiplicative-expression
+ additive-expression <l>+</l> multiplicative-expression
+ additive-expression <l>-</l> multiplicative-expression
+ </blockquote>
+ </section>
+ <section id="shift">
+ <h>Shift operations</h>
+ <blockquote>
+shift-expression:
+ additive-expression
+ shift-expression <l>&lt;&lt;</l> additive-expression
+ shift-expression <l>&gt;&gt;</l> additive-expression
+ </blockquote>
+ </section>
+ <section id="relational">
+ <h>Relational operations</h>
+ <blockquote>
+relational-expression:
+ shift-expression
+ relational-expression <l>&lt;</l> shift-expression
+ relational-expression <l>&lt;=</l> shift-expression
+ relational-expression <l>&gt;</l> shift-expression
+ relational-expression <l>&gt;=</l> shift-expression
+
+equality-expression:
+ relational-expression
+ equality-expression <l>==</l> relational-expression
+ equality-expression <l>!=</l> relational-expression
+ </blockquote>
+ </section>
+ <section id="logical">
+ <h>Logical operations</h>
+ <blockquote>
+and-expression:
+ equality-expression
+ and-expression <l>&amp;</l> equality-expression
+
+exclusive-or-expression:
+ and-expression
+ exclusive-or-expression <l>^</l> and-expression
+
+inclusive-or-expression:
+ exclusive-or-expression
+ inclusive-or-expression <l>|</l> exclusive-or-expression
+ </blockquote>
+ </section>
+ <section id="assignments">
+ <h>Assignments</h>
+ <blockquote>
+assigment:
+ unary-expression <l>=</l> expression
+ unary-expression <l>+=</l> expression
+ unary-expression <l>-=</l> expression
+ unary-expression <l>*=</l> expression
+ unary-expression <l>/=</l> expression
+ unary-expression <l>%=</l> expression
+ unary-expression <l>&amp;=</l> expression
+ unary-expression <l>|=</l> expression
+ unary-expression <l>^=</l> expression
+ unary-expression <l>&lt;&lt;=</l> expression
+ unary-expression <l>&gt;&gt;=</l> expression
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/index.xml b/doc/manual/index.xml
new file mode 100644
index 000000000..7c65624e9
--- /dev/null
+++ b/doc/manual/index.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<html xmlns:xi="http://www.w3.org/2001/XInclude">
+ <head>
+ <title>Vala Reference Manual</title>
+ </head>
+ <body>
+ <h>Vala Reference Manual</h>
+ <xi:include href="overview.xml"/>
+ <xi:include href="types.xml"/>
+ <xi:include href="expressions.xml"/>
+ <xi:include href="statements.xml"/>
+ <xi:include href="namespaces.xml"/>
+ <xi:include href="methods.xml"/>
+ <xi:include href="classes.xml"/>
+ <xi:include href="structs.xml"/>
+ <xi:include href="interfaces.xml"/>
+ <xi:include href="enums.xml"/>
+ <xi:include href="delegates.xml"/>
+ <xi:include href="exceptions.xml"/>
+ <xi:include href="attributes.xml"/>
+ </body>
+</html>
+
diff --git a/doc/manual/interfaces.xml b/doc/manual/interfaces.xml
new file mode 100644
index 000000000..fa473ea82
--- /dev/null
+++ b/doc/manual/interfaces.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<section id="interfaces">
+ <h>Interfaces</h>
+ <p>Interfaces can be implemented by classes to provide functionality with a common interface. Each class
+ can implement multiple interface and interfaces can require other interfaces to be implemented.</p>
+ <section id="declaration">
+ <h>Interface declarations</h>
+ <blockcode>
+ public interface InterfaceName : RequiredInterface &lt;optional&gt;
+ {
+ &lt;interface members&gt;
+ }
+ </blockcode>
+ </section>
+ <section id="methods">
+ <h>Methods</h>
+ <p>Interfaces can contain abstract and non abstract methods.</p>
+ <blockcode>
+ public abstract void MethodName ();
+ public void MethodName2 ()
+ {
+ &lt;Implementation&gt;
+ }
+ </blockcode>
+ </section>
+ <section id="delegates">
+ <h>Delegates</h>
+ <p>Interfaces can also contain delegates</p>
+ <blockcode>
+ public delegate void DelegateName (void* data);
+ </blockcode>
+ </section>
+ <section id="signals">
+ <h>Signals</h>
+ <p>Signals are also supported by interfaces</p>
+ <blockcode>
+ public signal void SignalName ();
+ </blockcode>
+ </section>
+</section>
+
diff --git a/doc/manual/methods.xml b/doc/manual/methods.xml
new file mode 100644
index 000000000..b7ac154e5
--- /dev/null
+++ b/doc/manual/methods.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<section id="methods">
+ <h>Methods</h>
+ <section id="declaration">
+ <h>Method declarations</h>
+ <p>Methods may be declared in namespaces, classes, interfaces, structs, enums, and error domains</p>
+ <blockquote>
+method-declaration:
+ [ access-modifier ] [ member-modifers ] return-type qualified-identifier ( [ parameter-list ] ) method-contract [ <l>throws</l> error-list ] <l>{</l> statement-list <l>}</l>
+
+member-modifiers:
+ member-modifier [ member-modifiers ]
+
+member-modifier:
+ <l>abstract</l>
+ <l>class</l>
+ <l>extern</l>
+ <l>inline</l>
+ <l>override</l>
+ <l>static</l>
+ <l>virtual</l>
+
+return-type:
+ type
+ <l>void</l>
+
+parameter-list:
+ [ parameter-direction ] type identifier [ <l>,</l> parameter-list ]
+
+parameter-direction:
+ <l>ref</l>
+ <l>out</l>
+
+method-contract:
+ [ <l>requires</l> <l>(</l> expression <l>)</l> ] [ <l>ensures</l> <l>(</l> expression <l>)</l> ]
+
+error-list:
+ error-type [ <l>,</l> error-list ]
+
+</blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/namespaces.xml b/doc/manual/namespaces.xml
new file mode 100644
index 000000000..17c7dc473
--- /dev/null
+++ b/doc/manual/namespaces.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<section id="namespaces">
+ <h>Namespaces</h>
+ <section id="declaration">
+ <h>Namespace declarations</h>
+ <blockquote>
+namespace-declaration:
+ <l>namespace</l> qualified-identifier <l>{</l> [ namespace-members ] <l>}</l>
+
+qualified-identifier:
+ [ qualified-identifier <l>.</l> ] identifier
+
+namespace-members:
+ [ namespace-members ] namespace-member
+
+namespace-member:
+ namespace-declaration
+ method-declaration
+ field-declaration
+ constant-declaration
+ class-declaration
+ struct-declaration
+ interface-declaration
+ enum-declaration
+ delegate-declaration
+ errordomain-declaration
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/overview.xml b/doc/manual/overview.xml
new file mode 100644
index 000000000..7748d84ab
--- /dev/null
+++ b/doc/manual/overview.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<section id="overview">
+ <h>Overview</h>
+ <p>Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.</p>
+ <section id="gettingstarted">
+ <h>Getting started</h>
+ <p>The classic "Hello, world" example in Vala:</p>
+ <blockcode>
+using GLib;
+
+public class Sample : Object {
+ public Sample () {
+ }
+
+ public void run () {
+ stdout.printf ("Hello, world!\n");
+ }
+
+ static int main (string[] args) {
+ var sample = new Sample ();
+ sample.run ();
+ return 0;
+ }
+}</blockcode>
+ <p>Store the code in a file whose name ends in ".vala", such as <code>hello.vala</code>, and compile it with the command:</p>
+ <blockcode>valac -o hello hello.vala</blockcode>
+ <p>This will produce an executable file called <code>hello</code>.</p>
+ </section>
+</section>
+
diff --git a/doc/manual/statements.xml b/doc/manual/statements.xml
new file mode 100644
index 000000000..121b27a21
--- /dev/null
+++ b/doc/manual/statements.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<section id="statements">
+ <h>Statements</h>
+ <section id="selection">
+ <h>Selection statements</h>
+ <p>The if statement selects a statement for execution based on the value of a boolean expression.</p>
+ <blockquote>
+if-statement:
+ <l>if (</l> boolean-expression <l>)</l> embedded-statement
+ <l>if (</l> boolean-expression <l>)</l> embedded-statement <l>else</l> embedded-statement
+ </blockquote>
+ </section>
+ <section id="iteration">
+ <h>Iteration statements</h>
+ <p>The while statement conditionally executes an embedded statement zero or more times.</p>
+ <blockquote>
+while-statement:
+ <l>while (</l> boolean-expression <l>)</l> embedded-statement
+ </blockquote>
+ <p>The do statement conditionally executes an embedded statement one or more times.</p>
+ <blockquote>
+do-statement:
+ <l>do</l> embedded-statement <l>while (</l> boolean-expression <l>) ;</l>
+ </blockquote>
+ <p>The for statement evaluates a sequence of initialization expressions and then, while a condition is true, repeatedly executes an embedded statement and evaluates a sequence of iteration expressions.</p>
+ <blockquote>
+for-statement:
+ <l>for (</l> [for-initializer] <l>;</l> [for-condition] <l>;</l> [for-iterator] <l>)</l> embedded-statement
+
+for-initializer:
+ local-variable-declaration
+ statement-expression-list
+
+for-condition:
+ boolean-expression
+
+for-iterator:
+ statement-expression-list
+
+statement-expression-list:
+ statement-expression
+ statement-expression-list <l>,</l> statement-expression
+ </blockquote>
+ <p>Within the embedded statement of a for statement, a break statement can be used to transfer control to the end point of the for statement (thus ending iteration of the embedded statement), and a continue statement can be used to transfer control to the end point of the embedded statement (thus executing another iteration of the for statement).</p>
+ <p>The foreach statement enumerates the elements of a collection, executing an embedded statement for each element of the collection.</p>
+ <blockquote>
+foreach-statement:
+ <l>foreach (</l> type identifier <l>in</l> expression <l>)</l> embedded-statement
+ </blockquote>
+ </section>
+ <section id="jump">
+ <h>Jump statements</h>
+ <p>The break statement exits the nearest enclosing switch, while, do, for, or foreach statement.</p>
+ <blockquote>
+break-statement:
+ <l>break ;</l>
+ </blockquote>
+ <p>The continue statement starts a new iterataion of the nearest enclosing while, do, for, or foreach statement.</p>
+ <blockquote>
+continue-statement:
+ <l>continue ;</l>
+ </blockquote>
+ <p>When multiple while, do, for, or foreach statements are nested within each other, a continue statement applies only to the innermost statement. If a continue statement is not eclosed by a while, do, for, or foreach statement, a compile-time error occurs.</p>
+ <p>The return statement returns control to the caller of the function member in which the return statement appears.</p>
+ <blockquote>
+return-statement:
+ <l>return</l> [expression] <l>;</l>
+ </blockquote>
+ <p>The throw statement throws an exception.</p>
+ <blockquote>
+throw-statement:
+ <l>throw</l> expression <l>;</l>
+ </blockquote>
+ </section>
+ <section id="try">
+ <h>Try statement</h>
+ <p>The try statement provides a mechanism for catching exceptions that occur during execution of a block. Furthermore, the try statement provides the ability to specify a block of code that is always executed when control leaves the try statement.</p>
+ <blockquote>
+try-statement:
+ <l>try</l> block catch-clauses
+ <l>try</l> block [catch-clauses] finally-clause
+
+catch-clauses:
+ specific-catch-clause
+ [specific-catch-clauses] general-catch-clause
+
+specific-catch-clause:
+ specific-catch-clause
+ specific-catch-clauses specific-catch-clause
+
+specific-catch-clause:
+ <l>catch (</l> error-type identifier <l>)</l> block
+
+general-catch-clause:
+ <l>catch</l> block
+
+finally-clause:
+ <l>finally</l> block
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/structs.xml b/doc/manual/structs.xml
new file mode 100644
index 000000000..378cdea31
--- /dev/null
+++ b/doc/manual/structs.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<section id="structs">
+ <h>Structs</h>
+ <p>A struct is a data type that can contain fields, constants, and methods.</p>
+ <section id="declaration">
+ <h>Struct declarations</h>
+ <p>The simplest struct declaration looks like this:</p>
+ <blockcode>
+struct StructName {
+ &lt;struct-member&gt;
+}</blockcode>
+ <p>You may optionally specify an accessibility modifier. Structs support <code>public</code> and <code>private</code> accessibility and default to private if you don't specify one. Public structs may be accessed from outside the library or application they are defined in.</p>
+ <blockcode>
+public struct StructName {
+ &lt;struct-member&gt;
+}</blockcode>
+ <p>You may optionally prefix the struct name with a namespace name. This places the struct in the specified namespace without the need for a separate namespace declaration.</p>
+ <blockcode>
+struct NamespaceName.StructName {
+ &lt;struct-member&gt;
+}</blockcode>
+ </section>
+ <section id="fields">
+ <h>Fields</h>
+ <p>Documentation</p>
+ </section>
+ <section id="methods">
+ <h>Methods</h>
+ <p>Documentation</p>
+ </section>
+ <section id="properties">
+ <h>Properties</h>
+ <p>Documentation</p>
+ </section>
+</section>
+
diff --git a/doc/manual/types.xml b/doc/manual/types.xml
new file mode 100644
index 000000000..8b383f48d
--- /dev/null
+++ b/doc/manual/types.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0"?>
+<section id="types">
+ <h>Types</h>
+ <p>Vala supports four kinds of data types: value types, reference types, type parameters, and pointer types. Value types include simple types (e.g. char, int, and float), enum types, array types, and struct types. Reference types include object types, delegate types, and error types. Type parameters are parameters used in generic types.</p>
+ <p>Value types differ from reference types in that variables of the value types directly contain their data, whereas variables of the reference types store references to their data, the latter being known as objects. With reference types, it is possible for two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. With value types, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other.</p>
+ <blockquote>
+type:
+ value-type
+ reference-type
+ nullable-type
+ type-parameter
+ pointer-type
+ </blockquote>
+ <section id="valuetypes">
+ <h>Value types</h>
+ <p>Instances of value types are stored directly in variables. They are duplicated whenever assigned to another variable (e.g. passed to a method). For local variables, value types are stored on the stack.</p>
+ <blockquote>
+value-type:
+ struct-type
+ enum-type
+ array-type
+
+struct-type:
+ type-name
+ integral-type
+ floating-point-type
+ <l>bool</l>
+
+integral-type:
+ <l>char</l>
+ <l>uchar</l>
+ <l>short</l>
+ <l>ushort</l>
+ <l>int</l>
+ <l>uint</l>
+ <l>long</l>
+ <l>ulong</l>
+ <l>size_t</l>
+ <l>ssize_t</l>
+ <l>int8</l>
+ <l>uint8</l>
+ <l>int16</l>
+ <l>uint16</l>
+ <l>int32</l>
+ <l>uint32</l>
+ <l>int64</l>
+ <l>uint64</l>
+ <l>unichar</l>
+
+floating-point-type:
+ <l>float</l>
+ <l>double</l>
+
+enum-type:
+ type-name
+
+array-type:
+ non-array-type <l>[]</l>
+ non-array-type <l>[</l> dim-seperators <l>]</l>
+
+non-array-type:
+ value-type
+ object-type
+ class-type
+ delegate-type
+ error-type
+
+dim-separators:
+ <l>,</l>
+ dim-separators <l>,</l>
+ </blockquote>
+ <section id="structtypes">
+ <h>Struct types</h>
+ <p>Documentation</p>
+ </section>
+ <section id="simpletypes">
+ <h>Simple types</h>
+ <p>Documentation</p>
+ </section>
+ <section id="integraltypes">
+ <h>Integral types</h>
+ <p>Documentation</p>
+ </section>
+ <section id="floatingpointtypes">
+ <h>Floating point types</h>
+ <p>Documentation</p>
+ </section>
+ <section id="booltype">
+ <h>The bool type</h>
+ <p>Documentation</p>
+ </section>
+ <section id="enumtypes">
+ <h>Enumeration types</h>
+ <p>An enumeration type is a type containing named constants.</p>
+ <p>See enums.</p>
+ </section>
+ </section>
+ <section id="referencetypes">
+ <h>Reference types</h>
+ <p>Instances of reference types are always stored on the heap. Variables contain references to them. Assigning to another variable duplicates reference, not object.</p>
+ <blockquote>
+reference-type:
+ object-type
+ class-type
+ delegate-type
+ error-type
+ weak-reference-type
+
+weak-reference-type:
+ <l>weak</l> object-type
+ <l>weak</l> class-type
+ <l>weak</l> array-type
+ <l>weak</l> delegate-type
+ <l>weak</l> error-type
+
+object-type:
+ type-name
+ <l>string</l>
+
+class-type:
+ type-name <l>. Class</l>
+
+delegate-type:
+ type-name
+
+error-type:
+ type-name
+ </blockquote>
+ <section id="weakreferencetypes">
+ <h>Weak reference types</h>
+ <p>Documentation</p>
+ </section>
+ <section id="arraytypes">
+ <h>Array types</h>
+ <p>An array is a data structure that contains zero or more elements of the same type.</p>
+ </section>
+ <section id="delegatetypes">
+ <h>Delegate types</h>
+ <p>A delegate is a data structure that refers to a method, and for instance methods, it also refers to the corresponding object instance.</p>
+ </section>
+ <section id="errortypes">
+ <h>Error types</h>
+ <p>Instances of error types represent recoverable runtime errors.</p>
+ </section>
+ </section>
+ <section id="nullabletypes">
+ <h>Nullable types</h>
+ <p>An instance of a nullable type <code>T?</code> can either be a value of type <code>T</code> or <code>null</code>.</p>
+ <blockquote>
+nullable-type:
+ value-type <l>?</l>
+ reference-type <l>?</l>
+ </blockquote>
+ </section>
+ <section id="pointertypes">
+ <h>Pointer types</h>
+ <p>Unlike references, pointers are not tracked by the memory manager. The value of a pointer having type T* represents the address of a variable of type T. The pointer indirection operator * can be used to access this variable. Like a nullable object reference, a pointer can be null. The <code>void*</code> type represents a pointer to an unknown type. As the referent type is unknown, the indirection operator cannot be applied to a pointer of type <code>void*</code>, nor can any arithmetic be performed on such a pointer. However, a pointer of type <code>void*</code> can be cast to any other pointer type (and vice versa) and compared to values of other pointer types.</p>
+ <blockquote>
+pointer-type:
+ type-name <l>*</l>
+ pointer-type <l>*</l>
+ <l>void*</l>
+ </blockquote>
+ </section>
+</section>
+
diff --git a/doc/manual/xhtml.xsl b/doc/manual/xhtml.xsl
new file mode 100644
index 000000000..607fbaccd
--- /dev/null
+++ b/doc/manual/xhtml.xsl
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+ <xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
+ <xsl:strip-space elements="blockquote/l"/>
+ <xsl:template match="/">
+ <xsl:apply-templates select="html"/>
+ </xsl:template>
+ <xsl:template match="html">
+ <html><xsl:apply-templates select="head|body"/></html>
+ </xsl:template>
+ <xsl:template match="head">
+ <head>
+ <xsl:apply-templates select="title"/>
+ <link rel="stylesheet" type="text/css" href="default.css"/>
+ </head>
+ </xsl:template>
+ <xsl:template match="title">
+ <title><xsl:value-of select="."/></title>
+ </xsl:template>
+ <xsl:template match="body">
+ <body>
+ <div class="header">
+ <a href="index.html"><xsl:value-of select="//title/text()"/></a>
+ </div>
+ <xsl:apply-templates select="h|p|section"/>
+ <ul class="toc">
+ <xsl:for-each select="section">
+ <li>
+ <a href="{@id}.html"><xsl:value-of select="h/text()"/></a>
+ <xsl:if test="count(section) > 0">
+ <ul>
+ <xsl:for-each select="section">
+ <li><a href="{../@id}.html#{@id}"><xsl:value-of select="h/text()"/></a></li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </body>
+ </xsl:template>
+ <xsl:template match="body/h">
+ <h1><xsl:value-of select="text()"/></h1>
+ </xsl:template>
+ <xsl:template match="body/section">
+ <xsl:document href="{@id}.html" method="xml" indent="yes">
+ <html>
+ <head>
+ <title><xsl:value-of select="h/text()"/> - <xsl:value-of select="//title/text()"/></title>
+ <link rel="stylesheet" type="text/css" href="default.css"/>
+ </head>
+ <body>
+ <div class="header">
+ <a href="index.html"><xsl:value-of select="//title/text()"/></a>
+ </div>
+ <xsl:apply-templates select="h|p|section|div|blockcode|blockquote|ol|ul"/>
+ </body>
+ </html>
+ </xsl:document>
+ </xsl:template>
+ <xsl:template match="body/section/h">
+ <h2><xsl:value-of select="text()"/></h2>
+ </xsl:template>
+ <xsl:template match="body/section/section">
+ <xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
+ </xsl:template>
+ <xsl:template match="body/section/section/h">
+ <h3><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h3>
+ </xsl:template>
+ <xsl:template match="body/section/section/section">
+ <xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
+ </xsl:template>
+ <xsl:template match="body/section/section/section/h">
+ <h4><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h4>
+ </xsl:template>
+ <xsl:template match="div[@role='note']">
+ <div class="note"><xsl:apply-templates select="h|p|blockcode|blockquote"/></div>
+ </xsl:template>
+ <xsl:template match="div/h">
+ <h4><xsl:value-of select="text()"/></h4>
+ </xsl:template>
+ <xsl:template match="p">
+ <p><xsl:apply-templates select="text()|code"/></p>
+ </xsl:template>
+ <xsl:template match="code">
+ <code><xsl:value-of select="text()"/></code>
+ </xsl:template>
+ <xsl:template match="blockcode">
+ <pre><xsl:value-of select="text()"/></pre>
+ </xsl:template>
+ <xsl:template match="blockquote">
+ <blockquote><xsl:apply-templates select="text()|l"/></blockquote>
+ </xsl:template>
+ <xsl:template match="blockquote/l">
+ <span class="literal"><xsl:value-of select="text()"/></span>
+ </xsl:template>
+ <xsl:template match="ol">
+ <ol><xsl:apply-templates select="item"/></ol>
+ </xsl:template>
+ <xsl:template match="ul">
+ <ul><xsl:apply-templates select="item"/></ul>
+ </xsl:template>
+ <xsl:template match="ol/item|ul/item">
+ <li><xsl:value-of select="text()"/></li>
+ </xsl:template>
+</xsl:stylesheet>
+