[PATCH] Fix two treelang failures

James Morrison ja2morri@csclub.uwaterloo.ca
Tue Sep 28 13:52:00 GMT 2004


 Hi,

  This fixes two ices on the treelang testsuite on ppc-linux.  This test
has been tested with a make treelang.check, make info, make dvi.  After
this patch there are no failures for treelang.  Most of this patch is updating
the documentation.  I figure I should submit what I have so far since
assignments are coming on hard.

Jim

2004-09-28  James A. Morrison  <phython@gcc.gnu.org>

	* parse.y (ELSE): Set tok to $1.
	* treelang.texi: Wrap comments in @r{}.  Indent example comments.
	Use gcc when refering to the command line or website.  Update function
	definition.
	

Index: parse.y
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/treelang/parse.y,v
retrieving revision 1.12
diff -u -p -r1.12 parse.y
--- parse.y	8 Aug 2004 04:47:17 -0000	1.12
+++ parse.y	28 Sep 2004 12:39:19 -0000
@@ -515,7 +515,7 @@ ELSE {
 }
 LEFT_BRACE variable_defs_opt statements_opt RIGHT_BRACE {
   struct prod_token_parm_item* tok;
-  tok = $12;
+  tok = $1;
   tree_code_if_end (tok->tp.tok.location);
 }
 ;
Index: treelang.texi
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/treelang/treelang.texi,v
retrieving revision 1.11
diff -u -p -r1.11 treelang.texi
--- treelang.texi	21 Mar 2004 13:33:25 -0000	1.11
+++ treelang.texi	28 Sep 2004 12:39:19 -0000
@@ -2,7 +2,6 @@
 
 @c NOTE THIS IS NOT A GOOD EXAMPLE OF HOW TO DO A MANUAL. FIXME!!!
 @c NOTE THIS IS NOT A GOOD EXAMPLE OF HOW TO DO A MANUAL. FIXME!!!
-@c NOTE THIS IS NOT A GOOD EXAMPLE OF HOW TO DO A MANUAL. FIXME!!!
 
 
 @c %**start of header
@@ -10,9 +9,9 @@
 
 @include gcc-common.texi
 
-@set version-treelang 1.0
+@set version-treelang 2.0
 
-@set last-update 2004-03-21
+@set last-update 2004-09-28
 @set copyrights-treelang 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
 
 @set email-general gcc@@gcc.gnu.org
@@ -203,11 +202,6 @@ corresponds to the @value{which-treelang
 
 @end ifnottex
 
-@ifset DEVELOPMENT
-@emph{Warning:} This document is still under development, and might not
-accurately reflect the @code{treelang} code base of which it is a part.
-@end ifset
-
 @menu
 * Copying::                     
 * Contributors::                
@@ -272,7 +266,8 @@ Reporting Bugs
 Treelang was based on 'toy' by Richard Kenner, and also uses code from
 the GCC core code tree. Tim Josling first created the language and
 documentation, based on the GCC Fortran compiler's documentation
-framework.
+framework.  Treelang was updated to use the TreeSSA infrastructure by James A.
+Morrison.
 
 @itemize @bullet
 @item
@@ -290,7 +285,7 @@ It would have been difficult to build tr
 Nadler's guide to writing a front end to GCC (written in German). A
 translation of this document into English is available via the
 CobolForGCC project or via the documentation links from the GCC home
-page @uref{http://GCC.gnu.org}.
+page @uref{http://gcc.gnu.org}.
 @end itemize
 
 @include funding.texi
@@ -309,10 +304,13 @@ language. Therefore only language develo
 interest in it.
 
 This manual assumes familiarity with GCC, which you can obtain by using
-it and by reading the manual @samp{Using and Porting GCC}.
+it and by reading the manuals @samp{Using the GNU Compiler Collection (GCC)}
+and @samp{GNU Compiler Collection (GCC) Internals}.
 
 To install treelang, follow the GCC installation instructions, 
-taking care to ensure you specify treelang in the configure step.
+taking care to ensure you specify treelang in the configure step by adding
+treelang to the list of languages specified by @option{--enable-langauges}, 
+e.g.@: @samp{--enable-languages=all,treelang}.
 
 If you're generally curious about the future of
 @code{treelang}, see @ref{Projects}.
@@ -345,18 +343,18 @@ The main features missing are structures
 
 A sample program follows:
 
-@example
-// function prototypes
-// function 'add' taking two ints and returning an int
+@smallexample
+// @r{function prototypes}
+// @r{function 'add' taking two ints and returning an int}
 external_definition int add(int arg1, int arg2);
 external_definition int subtract(int arg3, int arg4);
 external_definition int first_nonzero(int arg5, int arg6);
 external_definition int double_plus_one(int arg7);
 
-// function definition
+// @r{function definition}
 add 
 @{
-// return the sum of arg1 and arg2
+  // @r{return the sum of arg1 and arg2}
   return arg1 + arg2;
 @}
 
@@ -368,9 +366,11 @@ subtract 
 
 double_plus_one
 @{
-// aaa is a variable, of type integer and allocated at the start of the function
+  // @r{aaa is a variable, of type integer and allocated at the start of}
+  // @r{the function}
   automatic int aaa;
-// set aaa to the value returned from add, when passed arg7 and arg7 as the two parameters
+  // @r{set aaa to the value returned from add, when passed arg7 and arg7 as}
+  // @r{the two parameters}
   aaa=add(arg7, arg7);
   aaa=add(aaa, aaa);
   aaa=subtract(subtract(aaa, arg7), arg7) + 1;
@@ -379,7 +379,7 @@ double_plus_one
 
 first_nonzero
 @{
-// C-like if statement
+  // @r{C-like if statement}
   if (arg5)
     @{
       return arg5;
@@ -389,7 +389,7 @@ first_nonzero
     @}
   return arg6;
 @}
-@end example
+@end smallexample
 
 @node Lexical Syntax, Parsing Syntax, What is GNU Treelang?, Top
 @chapter Lexical Syntax
@@ -415,7 +415,7 @@ of the line. C style comments (/* */) ar
 the assignment below is followed by a not very helpful comment.
 
 @smallexample
-x=1; // Set X to 1
+x = 1; // @r{Set X to 1}
 @end smallexample
 
 @item
@@ -427,7 +427,8 @@ used to start the statements in a functi
 @item @}
 used to end the statements in a function
 @item (
-start list of function arguments, or to change the precedence of operators in an expression
+start list of function arguments, or to change the precedence of operators in
+an expression
 @item )
 end list or prioritized operators in expression
 @item ,
@@ -494,7 +495,7 @@ file may contain one of more declaration
 declaration: variable declaration OR function prototype OR function declaration
 
 @item
-Function Prototype: storage type NAME ( parameter_list )
+Function Prototype: storage type NAME ( optional_parameter_list )
 
 @smallexample
 static int add (int a, int b)
@@ -506,10 +507,11 @@ variable_declaration: storage type NAME 
 Example:
 
 @smallexample
-int temp1=1;
+int temp1 = 1;
 @end smallexample
 
-A variable declaration can be outside a function, or at the start of a function.
+A variable declaration can be outside a function, or at the start of a
+function.
 
 @item
 storage: automatic OR static OR external_reference OR external_definition
@@ -602,7 +604,7 @@ list of statements may be empty, but bot
 @smallexample
 if (a==b) 
 @{
-// nothing
+// @r{nothing}
 @}
 else
 @{
@@ -623,8 +625,9 @@ be absent, and if the function is not vo
 present.
 
 @item
-expression: variable OR integer_constant OR expression+expression OR expression-expression
- OR expression==expression OR (expression) OR variable=expression OR function_call
+expression: variable OR integer_constant OR expression+expression
+OR expression-expression OR expression==expression OR (expression)
+OR variable=expression OR function_call
 
 An expression can be a constant or a variable reference or a
 function_call. Expressions can be combined as a sum of two expressions
@@ -890,7 +893,7 @@ the GNU Compiler Collection (GCC)},
 for information on the way different languages are handled
 by the GCC compiler (@code{gcc}).
 
-You can use this, combined with the output of the @samp{GCC -v x.tree}
+You can use this, combined with the output of the @samp{gcc -v x.tree}
 command to get the options applicable to treelang. Treelang programs
 must end with the suffix @samp{.tree}.
 



More information about the Gcc-patches mailing list