From c5ab383b8150f28b79c5f22afdb45069c5ef77ec Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Thu, 29 Nov 2007 13:00:23 +0000 Subject: [PATCH] add some basic documentation for statements, extend documentation 2007-11-29 Juerg Billeter * doc/vala/Makefile.am, doc/vala/classes.xml, doc/vala/default.css, doc/vala/delegates.xml, doc/vala/enums.xml, doc/vala/exceptions.xml, doc/vala/expressions.xml, doc/vala/index.xml, doc/vala/interfaces.xml, doc/vala/namespaces.xml, doc/vala/statements.xml, doc/vala/structs.xml, doc/vala/types.xml, doc/vala/xhtml.xsl: add some basic documentation for statements, extend documentation structure svn path=/trunk/; revision=735 --- ChangeLog | 9 +++++ doc/vala/Makefile.am | 2 + doc/vala/classes.xml | 16 ++++++++ doc/vala/default.css | 5 +++ doc/vala/delegates.xml | 4 ++ doc/vala/enums.xml | 12 ++++++ doc/vala/exceptions.xml | 9 +++++ doc/vala/expressions.xml | 16 ++++++++ doc/vala/index.xml | 1 + doc/vala/interfaces.xml | 16 ++++++++ doc/vala/namespaces.xml | 4 ++ doc/vala/statements.xml | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ doc/vala/structs.xml | 12 ++++++ doc/vala/types.xml | 8 ++++ doc/vala/xhtml.xsl | 7 +++- 15 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 doc/vala/exceptions.xml diff --git a/ChangeLog b/ChangeLog index 13d1a91..8456d6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-29 Jürg Billeter + + * doc/vala/Makefile.am, doc/vala/classes.xml, doc/vala/default.css, + doc/vala/delegates.xml, doc/vala/enums.xml, doc/vala/exceptions.xml, + doc/vala/expressions.xml, doc/vala/index.xml, doc/vala/interfaces.xml, + doc/vala/namespaces.xml, doc/vala/statements.xml, + doc/vala/structs.xml, doc/vala/types.xml, doc/vala/xhtml.xsl: add some + basic documentation for statements, extend documentation structure + 2007-11-28 Jürg Billeter * vala/parser.y, vala/scanner.l, vala/valamethod.vala, diff --git a/doc/vala/Makefile.am b/doc/vala/Makefile.am index 6688268..2c1a7bf 100644 --- a/doc/vala/Makefile.am +++ b/doc/vala/Makefile.am @@ -11,6 +11,7 @@ chapter_data = \ interfaces.html \ enums.html \ delegates.html \ + exceptions.html \ $(NULL) built_data = \ @@ -46,6 +47,7 @@ book_sources = \ interfaces.xml \ enums.xml \ delegates.xml \ + exceptions.xml \ $(NULL) MOSTLYCLEANFILES = $(built_data) diff --git a/doc/vala/classes.xml b/doc/vala/classes.xml index 812bebb..85feab5 100644 --- a/doc/vala/classes.xml +++ b/doc/vala/classes.xml @@ -44,5 +44,21 @@ class NamespaceName.ClassName { <class-member> } +
+ Fields +

Documentation

+
+
+ Methods +

Documentation

+
+
+ Properties +

Documentation

+
+
+ Signals +

Documentation

+
diff --git a/doc/vala/default.css b/doc/vala/default.css index 756949b..b4dfc40 100644 --- a/doc/vala/default.css +++ b/doc/vala/default.css @@ -63,3 +63,8 @@ pre { margin: 0 2em 1em 2em; } +blockquote { + font-style: italic; + white-space: pre; +} + diff --git a/doc/vala/delegates.xml b/doc/vala/delegates.xml index 0517ed9..4734e00 100644 --- a/doc/vala/delegates.xml +++ b/doc/vala/delegates.xml @@ -1,5 +1,9 @@
Delegates +
+ Delegate declarations +

Documentation

+
diff --git a/doc/vala/enums.xml b/doc/vala/enums.xml index 5b13675..3575146 100644 --- a/doc/vala/enums.xml +++ b/doc/vala/enums.xml @@ -1,5 +1,17 @@
Enums +
+ Enum declarations +

Documentation

+
+
+ Enum members +

Documentation

+
+
+ Methods +

Documentation

+
diff --git a/doc/vala/exceptions.xml b/doc/vala/exceptions.xml new file mode 100644 index 0000000..377bc84 --- /dev/null +++ b/doc/vala/exceptions.xml @@ -0,0 +1,9 @@ + +
+ Exceptions +
+ Exception handling +

Documentation

+
+
+ diff --git a/doc/vala/expressions.xml b/doc/vala/expressions.xml index 95e937e..e2a66ea 100644 --- a/doc/vala/expressions.xml +++ b/doc/vala/expressions.xml @@ -1,5 +1,21 @@
Expressions +
+ Arithmetic operations +

Documentation

+
+
+ Relational operations +

Documentation

+
+
+ Logical operations +

Documentation

+
+
+ Assignments +

Documentation

+
diff --git a/doc/vala/index.xml b/doc/vala/index.xml index 1a45706..e93939f 100644 --- a/doc/vala/index.xml +++ b/doc/vala/index.xml @@ -15,6 +15,7 @@ + diff --git a/doc/vala/interfaces.xml b/doc/vala/interfaces.xml index a692511..6f5f2ba 100644 --- a/doc/vala/interfaces.xml +++ b/doc/vala/interfaces.xml @@ -1,5 +1,21 @@
Interfaces +
+ Interface declarations +

Documentation

+
+
+ Methods +

Documentation

+
+
+ Properties +

Documentation

+
+
+ Signals +

Documentation

+
diff --git a/doc/vala/namespaces.xml b/doc/vala/namespaces.xml index da568ff..683430d 100644 --- a/doc/vala/namespaces.xml +++ b/doc/vala/namespaces.xml @@ -1,5 +1,9 @@
Namespaces +
+ Namespace declarations +

Documentation

+
diff --git a/doc/vala/statements.xml b/doc/vala/statements.xml index 421bc94..ec124e1 100644 --- a/doc/vala/statements.xml +++ b/doc/vala/statements.xml @@ -1,5 +1,102 @@
Statements +
+ Selection statements +

The if statement selects a statement for execution based on the value of a boolean expression.

+
+if-statement: + if ( boolean-expression ) embedded-statement + if ( boolean-expression ) embedded-statement else embedded-statement +
+
+
+ Iteration statements +

The while statement conditionally executes an embedded statement zero or more times.

+
+while-statement: + while ( boolean-expression ) embedded-statement +
+

The do statement conditionally executes an embedded statement one or more times.

+
+do-statement: + do embedded-statement while ( boolean-expression ) ; +
+

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.

+
+for-statement: + for ( [for-initializer] ; [for-condition] ; [for-iterator] ) 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 , statement-expression +
+

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).

+

The foreach statement enumerates the elements of a collection, executing an embedded statement for each element of the collection.

+
+foreach-statement: + foreach ( type identifier in expression ) embedded-statement +
+
+
+ Jump statements +

The break statement exits the nearest enclosing switch, while, do, for, or foreach statement.

+
+break-statement: + break ; +
+

The continue statement starts a new iterataion of the nearest enclosing while, do, for, or foreach statement.

+
+continue-statement: + continue ; +
+

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.

+

The return statement returns control to the caller of the function member in which the return statement appears.

+
+return-statement: + return [expression] ; +
+

The throw statement throws an exception.

+
+throw-statement: + throw expression ; +
+
+
+ Try statement +

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.

+
+try-statement: + try block catch-clauses + try 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: + catch ( error-type identifier ) block + +general-catch-clause: + catch block + +finally-clause: + finally block +
+
diff --git a/doc/vala/structs.xml b/doc/vala/structs.xml index c3ef1cd..378cdea 100644 --- a/doc/vala/structs.xml +++ b/doc/vala/structs.xml @@ -20,5 +20,17 @@ struct NamespaceName.StructName { <struct-member> } +
+ Fields +

Documentation

+
+
+ Methods +

Documentation

+
+
+ Properties +

Documentation

+
diff --git a/doc/vala/types.xml b/doc/vala/types.xml index 3d6f44b..75a554d 100644 --- a/doc/vala/types.xml +++ b/doc/vala/types.xml @@ -3,5 +3,13 @@ Types

Vala supports two kinds of data types: value types and reference types. Value types include simple types (e.g. char, int, and float), enum types, and struct types. Reference types include class types, interface types, and array types.

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.

+
+ Value types +

Documentation

+
+
+ Reference types +

Documentation

+
diff --git a/doc/vala/xhtml.xsl b/doc/vala/xhtml.xsl index 4b62878..006e290 100644 --- a/doc/vala/xhtml.xsl +++ b/doc/vala/xhtml.xsl @@ -61,13 +61,13 @@

- +

-
+

@@ -81,5 +81,8 @@
+ +
+
-- 2.7.4