Commit d9771cbd by James A. Morrison

treelang.texi: Fix whitespacing.

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

        * treelang.texi: Fix whitespacing.

From-SVN: r95568
parent ae7a0271
2005-02-25 James A. Morrison <phython@gcc.gnu.org>
* treelang.texi: Fix whitespacing.
2005-02-24 James A. Morrison <phython@gcc.gnu.org>
PR other/19896
......
......@@ -259,8 +259,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. Treelang was updated to use the TreeSSA infrastructure by James A.
Morrison.
framework. Treelang was updated to use the TreeSSA infrastructure by
James A. Morrison.
@itemize @bullet
@item
......@@ -618,9 +618,9 @@ be absent, and if the function is not void the expression must be
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
......@@ -629,7 +629,7 @@ expresions. An assignment is also an expression. Expresions and operator
precedence work as in C.
@item
function_call: function_name (comma_separated_expressions)
function_call: function_name ( optional_comma_separated_expressions )
This invokes the function, passing to it the values of the expressions
as actual parameters.
......@@ -746,7 +746,7 @@ The @code{libc} run-time library. This library contains the machine
code needed to support capabilities of the Treelang language that are
not directly provided by the machine code generated by the
@code{treelang} compilation phase. This is the same library that the
main c compiler uses (libc).
main C compiler uses (libc).
@cindex @code{tree1}, program
@cindex programs, @code{tree1}
......@@ -939,7 +939,7 @@ To create a compiler that integrates into GCC, you need create many
files. Some of the files are integrated into the main GCC makefile, to
build the various parts of the compiler and to run the test
suite. Others are incorporated into various GCC programs such as
GCC.c. Finally you must provide the actual programs comprising your
@file{gcc.c}. Finally you must provide the actual programs comprising your
compiler.
@cindex files
......@@ -1014,19 +1014,19 @@ usually generated, files should be excluded from diffs (ie when making
diff files to send in patches). Whether the equate 'stagestuff' is used
is unknown (???).
@cindex lang-options
@cindex lang.opt
@item
lang-options. This file is included into GCC.c, the main GCC driver, and
tells it what options your language supports. This is only used to
display help (is this true ???).
lang.opt. This file is included into @file{gcc.c}, the main GCC driver, and
tells it what options your language supports. This is also used to
display help.
@cindex lang-specs
@cindex lang-specs.h
@item
lang-specs. This file is also included in GCC.c. It tells GCC.c when to
call your programs and what options to send them. The mini-language
'specs' is documented in the source of GCC.c. Do not attempt to write a
specs file from scratch - use an existing one as the base and enhance
it.
lang-specs.h. This file is also included in @file{gcc.c}. It tells
@file{gcc.c} when to call your programs and what options to send them. The
mini-language 'specs' is documented in the source of @file{gcc.c}. Do not
attempt to write a specs file from scratch - use an existing one as the base
and enhance it.
@item
Your texi files. Texinfo can be used to build documentation in HTML,
......@@ -1041,20 +1041,21 @@ in the next section. You need to write or use the following programs:
@item
lexer. This breaks the input into words and passes these to the
parser. This is lex.l in treelang, which is passed through flex, a lex
variant, to produce C code lex.c. Note there is a school of thought that
says real men hand code their own lexers, however you may prefer to
parser. This is @file{lex.l} in treelang, which is passed through flex, a lex
variant, to produce C code @file{lex.c}. Note there is a school of thought
that says real men hand code their own lexers. However, you may prefer to
write far less code and use flex, as was done with treelang.
@item
parser. This breaks the program into recognizable constructs such as
expressions, statements etc. This is parse.y in treelang, which is
passed through bison, which is a yacc variant, to produce C code parse.c.
expressions, statements etc. This is @file{parse.y} in treelang, which is
passed through bison, which is a yacc variant, to produce C code
@file{parse.c}.
@item
back end interface. This interfaces to the code generation back end. In
treelang, this is tree1.c which mainly interfaces to toplev.c and
treetree.c which mainly interfaces to everything else. Many languages
treelang, this is @file{tree1.c} which mainly interfaces to @file{toplev.c} and
@file{treetree.c} which mainly interfaces to everything else. Many languages
mix up the back end interface with the parser, as in the C compiler for
example. It is a matter of taste which way to do it, but with treelang
it is separated out to make the back end interface cleaner and easier to
......@@ -1068,9 +1069,9 @@ the same header in your lexer. This technique is demonstrated in
treelang.
@item
compiler main file. GCC comes with a program toplev.c which is a
perfectly serviceable main program for your compiler. treelang uses
toplev.c but other languages have been known to replace it with their
compiler main file. GCC comes with a file @file{toplev.c} which is a
perfectly serviceable main program for your compiler. GNU Treelang uses
@file{toplev.c} but other languages have been known to replace it with their
own main program. Again this is a matter of taste and how much code you
want to write.
......@@ -1095,12 +1096,12 @@ want to write.
The GCC compiler consists of a driver, which then executes the various
compiler phases based on the instructions in the specs files.
Typically a program's language will be identified from its suffix (eg
.tree) for treelang programs.
Typically a program's language will be identified from its suffix
(e.g., @file{.tree}) for treelang programs.
The driver (gcc.c) will then drive (exec) in turn a preprocessor, the main
compiler, the assembler and the link editor. Options to GCC allow you to
override all of this. In the case of treelang programs there is no
The driver (@file{gcc.c}) will then drive (exec) in turn a preprocessor,
the main compiler, the assembler and the link editor. Options to GCC allow you
to override all of this. In the case of treelang programs there is no
preprocessor, and mostly these days the C preprocessor is run within the
main C compiler rather than as a separate process, apparently for reasons of speed.
......@@ -1120,11 +1121,12 @@ much time tuning it until you know you need to do so.
@node treelang main compiler, , treelang driver, treelang compiler interfaces
@subsection treelang main compiler
The main compiler for treelang consists of toplev.c from the main GCC
The main compiler for treelang consists of @file{toplev.c} from the main GCC
compiler, the parser, lexer and back end interface routines, and the
back end routines themselves, of which there are many.
toplev.c does a lot of work for you and you should almost certainly use it,
@file{toplev.c} does a lot of work for you and you should almost certainly
use it.
Writing this code is the hard part of creating a compiler using GCC. The
back end interface documentation is incomplete and the interface is
......
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