Commit e0fa00d1 by James A. Morrison

treelang.texi: Remove extra contribution notice.

2005-02-25  James A. Morrrison  <phython@gcc.gnu.org>

        * treelang.texi: Remove extra contribution notice.
        Split up some run-on sentences.  Document function parameters
        as optional.  Indicate automatic variables can now be at any scope.
        Mention literals are only signed if they are preceded by a unary
        plus or minus.  Clarify interoperability with C.

From-SVN: r95569
parent d9771cbd
2005-02-25 James A. Morrrison <phython@gcc.gnu.org>
* treelang.texi: Remove extra contribution notice.
Split up some run-on sentences. Document function parameters
as optional. Indicate automatic variables can now be at any scope.
Mention literals are only signed if they are preceded by a unary
plus or minus. Clarify interoperability with C.
2005-02-25 James A. Morrison <phython@gcc.gnu.org> 2005-02-25 James A. Morrison <phython@gcc.gnu.org>
* treelang.texi: Fix whitespacing. * treelang.texi: Fix whitespacing.
......
...@@ -107,8 +107,8 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) ...@@ -107,8 +107,8 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
@ifset INTERNALS @ifset INTERNALS
@ifset USING @ifset USING
This file documents the use and the internals of the GNU Treelang This file documents the use and the internals of the GNU Treelang
(@code{treelang}) compiler. At the moment this manual is not (@code{treelang}) compiler. At the moment this manual is not
incorporated into the main GCC manual as it is too incomplete. It incorporated into the main GCC manual as it is incomplete. It
corresponds to the @value{which-treelang} version of @code{treelang}. corresponds to the @value{which-treelang} version of @code{treelang}.
@end ifset @end ifset
@end ifset @end ifset
...@@ -128,12 +128,6 @@ Boston, MA 02111-1307 USA ...@@ -128,12 +128,6 @@ Boston, MA 02111-1307 USA
@insertcopying @insertcopying
@end ifnottex @end ifnottex
treelang was Contributed by Tim Josling (@email{@value{email-josling}}).
Inspired by and based on the 'toy' language, written by Richard Kenner.
This document was written by Tim Josling, based on the GNU C++
documentation.
@setchapternewpage odd @setchapternewpage odd
@c @finalout @c @finalout
@titlepage @titlepage
...@@ -174,23 +168,21 @@ Boston, MA 02111-1307, USA@* ...@@ -174,23 +168,21 @@ Boston, MA 02111-1307, USA@*
@ifset INTERNALS @ifset INTERNALS
@ifset USING @ifset USING
This manual documents how to run, install and maintain @code{treelang}, This manual documents how to run, install and maintain @code{treelang}.
as well as its new features and incompatibilities, It also documents the features and incompatibilities in the @value{which-treelang}
and how to report bugs. version of @code{treelang}.
It corresponds to the @value{which-treelang} version of @code{treelang}.
@end ifset @end ifset
@end ifset @end ifset
@ifclear INTERNALS @ifclear INTERNALS
This manual documents how to run and install @code{treelang}, This manual documents how to run and install @code{treelang}.
as well as its new features and incompatibilities, and how to report It also documents the features and incompatibilities in the @value{which-treelang}
bugs. version of @code{treelang}.
It corresponds to the @value{which-treelang} version of @code{treelang}.
@end ifclear @end ifclear
@ifclear USING @ifclear USING
This manual documents how to maintain @code{treelang}, as well as its This manual documents how to maintain @code{treelang}.
new features and incompatibilities, and how to report bugs. It It also documents the features and incompatibilities in the @value{which-treelang}
corresponds to the @value{which-treelang} version of @code{treelang}. version of @code{treelang}.
@end ifclear @end ifclear
@end ifnottex @end ifnottex
...@@ -429,9 +421,9 @@ used to separate parameters in a function prototype or in a function call ...@@ -429,9 +421,9 @@ used to separate parameters in a function prototype or in a function call
@item ; @item ;
used to end a statement used to end a statement
@item + @item +
addition addition, or unary plus for signed literals
@item - @item -
subtraction subtraction, or unary minus for signed literals
@item = @item =
assignment assignment
@item == @item ==
...@@ -443,7 +435,7 @@ begin 'else' portion of IF statement ...@@ -443,7 +435,7 @@ begin 'else' portion of IF statement
@item static @item static
indicate variable is permanent, or function has file scope only indicate variable is permanent, or function has file scope only
@item automatic @item automatic
indicate that variable is allocated for the life of the function indicate that variable is allocated for the life of the current scope
@item external_reference @item external_reference
indicate that variable or function is defined in another file indicate that variable or function is defined in another file
@item external_definition @item external_definition
...@@ -514,9 +506,9 @@ This defines the scope, duration and visibility of a function or variable ...@@ -514,9 +506,9 @@ This defines the scope, duration and visibility of a function or variable
@enumerate 1 @enumerate 1
@item @item
automatic: This means a variable is allocated at start of function and automatic: This means a variable is allocated at start of the current scope and
released when the function returns. This can only be used for variables released when the current scope is exited. This can only be used for variables
within functions. It cannot be used for functions. within functions. It cannot be used for functions.
@item @item
static: This means a variable is allocated at start of program and static: This means a variable is allocated at start of program and
...@@ -562,7 +554,7 @@ parameter_list OR parameter [, parameter]... ...@@ -562,7 +554,7 @@ parameter_list OR parameter [, parameter]...
@item @item
parameter: variable_declaration , parameter: variable_declaration ,
The variable declarations must not have initialisations. The variable declarations must not have initializations.
@item @item
initial: = value initial: = value
...@@ -570,28 +562,30 @@ initial: = value ...@@ -570,28 +562,30 @@ initial: = value
@item @item
value: integer_constant value: integer_constant
Values without a unary plus or minus are considered to be unsigned.
@smallexample @smallexample
eg 1 +2 -3 e.g.@: 1 +2 -3
@end smallexample @end smallexample
@item @item
function_declaration: name @{variable_declarations statements @} function_declaration: name @{ variable_declarations statements @}
A function consists of the function name then the declarations (if any) A function consists of the function name then the declarations (if any)
and statements (if any) within one pair of braces. and statements (if any) within one pair of braces.
The details of the function arguments come from the function The details of the function arguments come from the function
prototype. The function prototype must precede the function declaration prototype. The function prototype must precede the function declaration
in the file. in the file.
@item @item
statement: if_statement OR expression_statement OR return_statement statement: if_statement OR expression_statement OR return_statement
@item @item
if_statement: if (expression) @{ statements @} else @{ statements @} if_statement: if ( expression ) @{ variable_declarations statements @}
else @{ variable_declarations statements @}
The first lot of statements is executed if the expression is The first lot of statements is executed if the expression is
nonzero. Otherwise the second lot of statements is executed. Either nonzero. Otherwise the second lot of statements is executed. Either
list of statements may be empty, but both sets of braces and the else must be present. list of statements may be empty, but both sets of braces and the else must be present.
@smallexample @smallexample
...@@ -608,7 +602,7 @@ a=b; ...@@ -608,7 +602,7 @@ a=b;
@item @item
expression_statement: expression; expression_statement: expression;
The expression is executed and any side effects, such The expression is executed, including any side effects.
@item @item
return_statement: return expression_opt; return_statement: return expression_opt;
...@@ -716,8 +710,9 @@ the programmer's intention.) ...@@ -716,8 +710,9 @@ the programmer's intention.)
@cindex warnings @cindex warnings
@cindex questionable instructions @cindex questionable instructions
@item @item
There are no warnings in treelang. A program is either correct or in There are few warnings in treelang. A program is either correct or in
error. error. The only exception to this is an expression in a return statement for
functions that return nothing.
@end itemize @end itemize
@cindex components of treelang @cindex components of treelang
...@@ -919,8 +914,8 @@ and everybody else, so you should be able to freely mix treelang and C ...@@ -919,8 +914,8 @@ and everybody else, so you should be able to freely mix treelang and C
(and C++) code, with one proviso. (and C++) code, with one proviso.
C promotes small integer types to 'int' when used as function parameters and C promotes small integer types to 'int' when used as function parameters and
return values. The treelang compiler does not do this, so if you want to interface return values in non-prototyped functions. Since treelang has no
to C, you need to specify the promoted value, not the nominal value. non-prototyped functions, the treelang compiler does not do this.
@ifset INTERNALS @ifset INTERNALS
@node treelang internals, Open Questions, Other Languages, Top @node treelang internals, Open Questions, Other Languages, Top
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment