Commit d4c7b8a3 authored by Erwan Auer's avatar Erwan Auer

assignments: fixed undefined labels

* source/compiler_stages/tc_2/goals.rst,
* source/compiler_stages/tc_2/improvements.rst,
* source/compiler_stages/tc_3/code_to_write.rst,
* source/compiler_stages/tc_5/faq.rst,
* source/compiler_stages/tc_5/goals.rst,
* source/compiler_stages/tc_5/primitive_samples.rst,
* source/compiler_stages/tc_8/faq.rst,
* source/compiler_stages/tc_9/samples.rst,
* source/compiler_stages/tc_e/code_to_write.rst,
* source/instructions/coding_style/documentation_style.rst,
* source/instructions/coding_style/matters_of_style.rst,
* source/instructions/coding_style/name_conventions.rst,
* source/instructions/coding_style/use_of_cpp_features.rst,
* source/instructions/coding_style/use_of_foreign_features.rst,
* source/instructions/interactions.rst,
* source/instructions/rules_of_the_game.rst,
* source/instructions/submission.rst,
* source/instructions/tests/tests.rst,
* source/instructions/tests/writing_tests.rst,
* source/intro/history/tiger_2005.rst,
* source/intro/how_to_read_this_document.rst,
* source/intro/why_the_tiger_project.rst,
* source/source_code/project_layout/build_aux.rst,
* source/source_code/project_layout/lib_misc.rst,
* source/source_code/project_layout/src_ast.rst,
* source/tools/bibliography.rst,
* source/tools/gnu_build_system/gnu_build_system.rst,
* source/tools/monoburg.rst,
* source/tools/programming_environment.rst,
* source/tools/valgrind.rst: here.
parent 9519895e
Pipeline #6372 passed with stage
in 1 minute and 36 seconds
......@@ -7,7 +7,7 @@ Things to learn during this stage that you should remember:
Strict Coding Style
Following a strict coding style is an essential part of collaborative work. Understanding the rationales
behind rules is even better. See :ref:`Coding Style`.
behind rules is even better. See :ref:`Coding_Style`.
Memory Leak Trackers
Using tools such as Valgrind (see :ref:`Valgrind`) to track memory leaks.
......
......@@ -19,10 +19,10 @@ Introduce an Error class
class (one?), which will never trigger type checking errors.
Using Generic Visitors
Andrei Alexandrescu has done a very interesting work on generic implementation of Visitors, see :ref:`Modern C++
Design`. It does require advanced C++ skills, since it is based on type lists, which requires heavy use of
templates.
Andrei Alexandrescu has done a very interesting work on generic implementation of Visitors,
see :ref:`Modern C++ Design <Modern C++ Design>`. It does require advanced C++ skills,
since it is based on type lists, which requires heavy use of templates.
Using Visitor Combinators
Going even further that Andrei Alexandrescu, Nicolas Tisserand proposes an implementation of Visitor combinators,
see :ref:`Generic Visitors in C++`.
see :ref:`Generic Visitors in C++ <Generic Visitors in C++>`.
......@@ -5,7 +5,7 @@ TC-3 Code to Write
misc::scoped_map<Key, Data>
Complete the class template :code:`misc::scoped_map` in :code:`lib/misc/scoped-map.hh` and
:code:`lib/misc/scoped-map.hxx`. See :ref:`lib/misc`, See :ref:`scoped_map`, for more details.
:code:`lib/misc/scoped-map.hxx`. See :ref:`lib/misc`, see :ref:`scoped_map <scoped_map>` for more details.
Equip ast
Augment constructs "using" an identifier, such as :code:`CallExp`, with :code:`def_`, :code:`def_get`, and
......
......@@ -3,6 +3,8 @@
TC-5 FAQ
--------
.. _fp or fp:
‘$fp’ or ‘fp’?
Andrew Appel clearly has his HIR/LIR depend on the target in three different ways: the names of the frame pointer and result registers,
and the machine word size.
......
......@@ -47,7 +47,7 @@ Explicit template instantiations
You must be able to explain how templates are “compiled”. In addition, you know how to explicitly
instantiate templates, and explain what it can be used for. The implementation of :code:`temp::Identifier`
(and :code:`temp::Temp` and :code:`temp::Label`) is based on these ideas. See the corresponding rule in
:ref:`File Conventions` for some explanations on this topic.
:ref:`File_Conventions` for some explanations on this topic.
Covariant return
C++ supports covariance of the method return type. This feature is crucial to implement methods such
......
......@@ -9,6 +9,8 @@ This example is probably the simplest Tiger program.
0
.. _0.tig:
**File 4.53**: 0.tig
.. code::
......
......@@ -4,7 +4,7 @@ TC-8 FAQ
--------
Why do we have a :code:`TempMap`, and not Appel?
:ref:`$fp or fp`, for all the details. Pay special attention to
:ref:`$fp or fp <fp or fp>`, in :ref:`TC-5 FAQ`, for all the details. Pay special attention to
converting the temporaries where needed:
- the flow graph is independent of the temporaries
......
......@@ -13,18 +13,22 @@ short: we use :code:`-sI` instead of :code:`-S` to save place.
Allocating registers in the main function, when there is no register
pressure is easy, as, in particular, there are no spills. A direct
consequence is that many :code:`move` are now useless, and have
disappeared. For instance (:ref:`seven.tig`, :ref:`seven.s`):
disappeared. For instance (:ref:`seven.tig <seven.tig>`, :ref:`seven.s <seven.s>`):
.. code::
1 + 2 * 3
.. _seven.tig:
**File 4.86**: seven.tig
.. command-output:: tc -sI seven.tig
:shell:
:cwd: .
.. _seven.s:
**Example 4.126**: tc -sI seven.tig
.. command-output:: tc -S seven.tig > seven.s
......
......@@ -17,4 +17,5 @@ escapes::EscapesVisitor
:code:`src/escapes/escapes-visitor.cc`.
Introduce ast::Escapable
Ensure :code:`ast::VarDec` inherits from :code:`ast::Escapable`. See :ref:`Escapable`.
Ensure :code:`ast::VarDec` inherits from :code:`ast::Escapable`.
See :ref:`Escapable <Escapable>`.
......@@ -24,7 +24,7 @@ Rule: Write correct English
Rule: Be concise
For documentation as for any other kind of writing, the shorter, the
better: hunt useless words. :ref:`The Elements of Style`, for an
better: hunt useless words. See :ref:`The Elements of Style <The Elements of Style>`, for an
excellent set of writing guidelines.
Here are a few samples of things to avoid:
......@@ -100,7 +100,7 @@ Rule: Use :file:`rebox.el` to mark up paragraphs
Often one wants to leave a clear markup to separate different matters.
For declarations, this is typically done using the Doxygen :code:`\name
... \{ ... \}` sequence; for implementation files use :file:`rebox.el`
(:ref:`rebox.el`).
(:ref:`rebox.el <rebox.el>`).
Rule: Write Documentation in Doxygen
Documentation is a genuine part of programming, just as testing. We use
......
......@@ -76,7 +76,8 @@ Rule: Keep superclasses on the class declaration line
the same line. Leave a space at least on the right hand side of the
colon. If there is not enough room to do so, leave the colon on the
class declaration line (the opposite applies for constructor, see
:ref:`Put initializations below the constructor declaration`).
:ref:`Put initializations below the constructor declaration
<Put initializations below the constructor declaration>`).
.. code:: c++
......@@ -197,6 +198,8 @@ Rule: Leave no space between a function name and its argument(s), either formal
bool operator()(int n);
};
.. _Put initializations below the constructor declaration:
Rule: Put initializations below the constructor declaration
Don't put or initializations or constructor invocations on the same line
as you declare the constructor. As a matter of fact, don't even leave
......
......@@ -3,6 +3,8 @@
Name Conventions
----------------
.. _Stay out of reserved names:
Rule: Stay out of reserved names
The standard reserves a number of identifier classes, most notably
*_\*** [17.4.3.1.2]:
......@@ -18,7 +20,7 @@ Rule: Stay out of reserved names
Rule: Name your classes :code:`LikeThis`
Class should be named in mixed case; for instance :code:`Exp`,
:code:`StringExp`, :code:`TempMap`, :code:`InterferenceGraph` etc. This
applies to class templates. See :ref:`CStupidClassName`.
applies to class templates. See :ref:`CStupidClassName <CStupidClassName>`.
Rule: Name public members :code:`like_this`
......@@ -30,8 +32,8 @@ Rule: Name private/protected members :code:`like_this_`
protected members: you make it clear to the reader, you avoid gratuitous
warnings about conflicts in constructors, you leave the "beautiful"
name available for public members etc. We used to write
:code:`like_this`, but this goes against the standard, see :ref:`Stay out
of reserved names`.
:code:`like_this`, but this goes against the standard, see
:ref:`Stay out of reserved names <Stay out of reserved names>`.
For instance, write:
......@@ -49,7 +51,7 @@ Rule: Name private/protected members :code:`like_this_`
int first_, second_;
}
See :ref:`CStupidClassName`.
See :ref:`CStupidClassName <CStupidClassName>`.
Rule: Name your :code:`using` type alias :code:`foo_type`
When declaring a :code:`using` type alias, name the type :code:`foo_type`
......
......@@ -145,7 +145,7 @@ Rule: Use :code:`dynamic_cast` for type cases
:code:`typeid` will probably not.
More material can be found the chapter 8 of see :ref:`Thinking in C++
Volume 2`:
Volume 2 <Thinking in C++ Volume 2>`:
`Run-time type identification
<http://www.smart2help.com/e-books/ticpp-2nd-ed-vol-two/#_Toc53985808>`_.
......
......@@ -20,11 +20,11 @@ tools that we don't master: You are on your own, but, hey!, that's what
you're looking for, ain't it?
The Loki Library
See :ref:`Modern C++ Design`, for more information about Loki.
See :ref:`Modern C++ Design <Modern C++ Design>`, for more information about Loki.
The Boost Library
As provided by the unstable Debian packages :code:`libboost-*`.
See :ref:`Boost.org`.
See :ref:`Boost.org <Boost.org>`.
Any Other Parser or Scanner Generator
If you dislike Flex and/or Bison *but you already know how to use them*,
......
......@@ -44,8 +44,9 @@ A complete content
the compiler/tool. The following text by Simon Tatham is enlightening;
its scope goes way beyond the |project| Project:
`How to Report Bugs Effectively
<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>`_. See also :ref:`How
not to go about a programming assignment`, item "Be clever when using
<http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>`_. See also
:ref:`How not to go about a programming assignment
<How not to go about a programming assignment>`, item "Be clever when using
electronic mail".
A legible content
......
......@@ -10,7 +10,8 @@ follow.
**Rule: Thou Shalt Not Possess Thy Neighbor's Code**
It is *strictly* forbidden to possess code that is not yours. You
are encouraged to work with others, but don't get a copy of their code.
See :ref:`How not to go about a programming assignment`, for more hints on
See :ref:`How not to go about a programming assignment
<How not to go about a programming assignment>`, for more hints on
what will *not* be accepted.
......
......@@ -5,7 +5,7 @@ Submission
We use two kinds of project submissions in the project.
- For PTHL (:ref:`PTHL (TC-0)`), your *sources* must be pushed
- For PTHL (:ref:`PTHL`), your *sources* must be pushed
through the :code:`master` branch to the central Git repository at
submission time. Follow the instructions given by the teaching
assistants.
......
......@@ -3,7 +3,7 @@
Tests
=====
As stated in :ref:`Rules of the Game`, writing a test framework and tests
As stated in :ref:`Rules_of_the_Game`, writing a test framework and tests
is part of the exercise.
As a starting point, we provide a tarball containing a few
......
......@@ -15,5 +15,5 @@ In three occasions tests are "easy" to write:
- If you are developing a component for the compiler, you can certainly
feel the weak points. Immediately write a test for these.
:ref:`Testing student-made compilers`, for many hints on what tests you
need to write.
See :ref:`Testing student-made compilers <Testing student-made compilers>`,
for many hints on what tests you need to write.
......@@ -67,7 +67,7 @@ Too many memory leaks
Too long to compile
Too much code was in `*.hh` files. Since then the policy wrt file
contents was defined (See :ref:`File Conventions`), and in |Project|
contents was defined (See :ref:`File_Conventions`), and in |Project|
2006 was adjusted to obey these conventions. Unfortunately, although
the improvement was significant, it was not measured precisely.
......@@ -94,8 +94,8 @@ Filling holes is not interesting
No written conventions
Since its inception, the |project| Compiler Project lacked this very section
(See :ref:`History`) and that dedicated to coding style (See :ref:`Coding
Style`) until the debriefing of 2005. As a result, some students or even so
(See :ref:`History`) and that dedicated to coding style (See :ref:`Coding_Style`)
until the debriefing of 2005. As a result, some students or even so
co-developers of our own `tc` reproduced errors of the past, changed something
for lack of understanding, slightly broke the homogeneity of the coding style
etc. Do not make the same mistake: write down your policy.
......
......@@ -27,7 +27,7 @@ Incremental
Auxiliary
This information is provided to help you: just go there when you feel the
need, :ref:`Tools`, and :ref:`Source Code`. If you want to have a better understanding
need, :ref:`Tools`, and :ref:`Source_Code`. If you want to have a better understanding
of the project, if you are about to criticize something, be sure to read
:ref:`History` beforehand.
......
......@@ -51,7 +51,7 @@ Understanding Computers:
understanding how it works, and therefore *how to perform a good
job*. Although most students will never be asked to write a single line
of assembly during their whole lives, knowing assembly is also of help.
:ref:`Bjarne Stroustrup`, for instance, says:
See :ref:`Bjarne Stroustrup <Bjarne Stroustrup>`, for instance, says:
Q: What is your opinion, is knowing assembly language useful for
programmers nowadays?
......@@ -63,8 +63,8 @@ English
English is *the* language for this project, starting with this very document,
written by a French person, for French students. You cannot be a good computer
scientist with absolutely no fluency in English. The following quote is from
Bjarne Stroustrup, who is danish (:ref:`The Design and Evolution of C++`,
6.5.3.2 Extended Character Sets):
Bjarne Stroustrup, who is danish (See :ref:`The Design and Evolution of C++
<The Design and Evolution of C++>`, 6.5.3.2 Extended Character Sets):
English has an important role as a common language for programmers, and
I suspect that it would be unwise to abandon that without serious
......@@ -74,8 +74,7 @@ English
*do not translate this document nor any other*. Ask support to the
Yakas, or to the English team. By the past, some oral and written
examinations were made in English. It may well be back some day. Some
books will help you to improve your English, see :ref:`The Elements of
Style`.
books will help you to improve your English, see :ref:`The Elements of Style <The Elements of Style>`.
Compiler
The project aims at the implementation of a compiler, but **this is
......@@ -85,10 +84,12 @@ Compiler
the full list of all these items is.
The |project| project is not unique in these regards, see
:ref:`Cool - The Classroom Object-Oriented Compiler`, for instance, with
:ref:`Cool - The Classroom Object-Oriented Compiler
<Cool - The Classroom Object-Oriented Compiler>`, for instance, with
many strikingly similar goals, and some profound differences. See also
:ref:`Making Compiler Design Relevant for Students who will (Most Likely)
Never Design a Compiler`, for an explanation of why compilation
Never Design a Compiler <Making Compiler Design Relevant for Students who will (Most Likely)
Never Design a Compiler>`, for an explanation of why compilation
techniques have a broader influence than they seem.
......
......@@ -20,6 +20,8 @@ The :code:`build-aux` Directory
Likewise for MonoBURG.
.. _rebox.el:
**File: rebox.el(build-aux/)**
This file provides two new Emacs fucntions, :code:`M-x rebox-comment` and :code:`M-x rebox-region`.
......
......@@ -78,6 +78,8 @@ Convenient C++ tools.
A wrapper around :code:`std::set` that introduce convenient operators (:code:`operator+` and so forth).
.. _scoped_map:
**File: scoped-map.\* (lib/misc/)**
The handling of :code:`misc::scoped_map<Key, Data>`, generic scoped map, serving as a basis for symbol
......
......@@ -81,6 +81,8 @@ Namespace :code:`ast`, delivered for TC-2. Implementation of the abstract syntax
It is convenient to be able to visit these, but it is not needed.
.. _Escapable:
**File: escapable.* (src/ast/)**
This class is needed only for TC-E.
......
This diff is collapsed.
......@@ -6,7 +6,7 @@ The GNU Build System
Automake is used to facilitate the writing of power :file:`Makefile`.
Libtool eases the creation of libraries, especially dynamic ones.
Autoconf is required by Automake: we do not address portability issues
for this project. :ref:`Autotools Tutorial`, for documentation.
for this project. See :ref:`Autotools Tutorial <Autotools Tutorial>`, for documentation.
Using :code:`info` is pleasant, for instance :code:`info autoconf` on
any properly set up system.
......
......@@ -22,5 +22,7 @@ Resources:
Some papers on code generator generators are available in the
bibliography. :ref:`BURG - Fast Optimal Instruction Selection and Tree
Parsing`, and :ref:`Engineering a simple efficient code generator
generator`.
Parsing <BURG - Fast Optimal Instruction Selection and Tree
Parsing>`, and :ref:`Engineering a simple efficient code generator
generator <Engineering a simple efficient code generator
generator>`.
......@@ -22,7 +22,7 @@ This section lists the tools you need to work in good conditions.
+----------+-------------------+------------------------------------+
| GNU Make | |makeversion| | |
+----------+-------------------+------------------------------------+
| Boost | |boostversion| | TC >= 5, :ref:`Boost.org`. |
| Boost | |boostversion| | TC >= 5, :ref:`Boost <Boost.org>` |
+----------+-------------------+------------------------------------+
| Doxygen | |doxygenversion| | :ref:`DoxygenTC`. |
+----------+-------------------+------------------------------------+
......
......@@ -39,7 +39,7 @@ I (Akim) personally use the following shell script to track memory leaks:
**File 5.1**: v
For instance on :ref:`0.tig`,
For instance on :ref:`0.tig <0.tig>`,
.. command-output:: v tc -XA 0.tig
:shell:
......
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