Commit 8855f25d authored by Erwan Auer's avatar Erwan Auer

assignments: fixed useless quotes surronding code samples

* source/compiler_stages/tc_2/code_to_write.rst,
* source/compiler_stages/tc_2/given_code.rst,
* source/compiler_stages/tc_2/pretty_printing_samples.rst,
* source/compiler_stages/tc_3/faq.rst,
* source/compiler_stages/tc_3/given_code.rst,
* source/compiler_stages/tc_4/given_code.rst,
* source/compiler_stages/tc_5/code_to_write.rst,
* source/compiler_stages/tc_5/given_code.rst,
* source/compiler_stages/tc_5/goals.rst,
* source/compiler_stages/tc_5/improvements.rst,
* source/compiler_stages/tc_5/optimizing_cascading_if.rst,
* source/compiler_stages/tc_5/primitive_samples.rst,
* source/compiler_stages/tc_e/code_to_write.rst,
* source/source_code/given_code.rst,
* source/source_code/project_layout/build_aux.rst,
* source/source_code/project_layout/src_ast.rst,
* source/source_code/project_layout/src_bind.rst,
* source/source_code/project_layout/src_escapes.rst,
* source/source_code/project_layout/src_overload.rst,
* source/source_code/project_layout/src_parse.rst,
* source/source_code/project_layout/src_translate.rst,
* source/source_code/project_layout/src_type.rst,
* source/source_code/project_layout/the_top_level.rst: here.
parent 648385a6
Pipeline #6333 passed with stage
in 1 minute and 5 seconds
......@@ -14,10 +14,10 @@ src/parse/parsetiger.yy
recommended.
Support metavariable constructs
Augment your scanner and your parser to support the (reserved) keywords ':code:`_decs`', ':code:`_exp`',
':code:`_lvalue`' and ':code:`_namety`' and implement the corresponding grammar rules (see
Augment your scanner and your parser to support the (reserved) keywords :code:`_decs`, :code:`_exp`,
:code:`_lvalue` and :code:`_namety` and implement the corresponding grammar rules (see
:ref:`Language Extensions` in *Tiger Compiler Reference Manual*). The semantic actions of these productions
shall use the ':code:`metavar`' function template to fetch the right AST subtree from the :code:`parse::Tweast`
shall use the :code:`metavar` function template to fetch the right AST subtree from the :code:`parse::Tweast`
object attached to the parsing context (:code:`parse::TigerParser` instance).
Implement error recovery.
......
......@@ -3,6 +3,6 @@
TC-2 Given Code
---------------
Code is provided through the ':code:`tc-base`' repository, using tag ':code:`2021-tc-base-2.0`'.
Code is provided through the :code:`tc-base` repository, using tag :code:`2021-tc-base-2.0`.
For a description of the new modules, see :ref:`lib/misc`, and :ref:`src/ast`.
......@@ -66,7 +66,7 @@ The parser builds abstract syntax trees that can be output by a pretty-printing
The pretty-printed output must be *valid* and *equivalent*.
Valid means that any Tiger compiler must be able to parse with success your output. Pay attention to the banners
such as ':code:`== Abstract...`': you should use comments: ':code:`/* == Abstract... */`'. Pay attention to
such as :code:`== Abstract...`: you should use comments: :code:`/* == Abstract... */`. Pay attention to
special characters too.
.. code::
......@@ -133,7 +133,7 @@ to '&', '|', unary '-', etc.
**Example 4.15**: tc -XA output.tig
Beware that :code:`for` loops are encoded using a :code:`ast::VarDec`: do not display the ':code:`var`':
Beware that :code:`for` loops are encoded using a :code:`ast::VarDec`: do not display the :code:`var`:
.. code::
......
......@@ -31,7 +31,7 @@ What is the purpose of the 'bound' task?
:code:`--object-bindings-compute` and :code:`--overfun-bindings-compute` respectively (see :ref:`Invoking tc`).
However, some subsequent task may later just require that an AST is annotated with bindings ("bound") regardless
of the technique used to compute these bindings. The purpose of the ':code:`bound`' task is to address this need:
of the technique used to compute these bindings. The purpose of the :code:`bound` task is to address this need:
ensuring that one of the bindings task has been executed. This task can be considered as a disjunction (logical
"or") of the ':code:`bindings-compute`', ':code:`object-bindings-compute`' and ':code:`overfun-bindings-compute`'
"or") of the :code:`bindings-compute`, :code:`object-bindings-compute` and :code:`overfun-bindings-compute`
tasks, the first one being the default binding strategy.
......@@ -3,5 +3,5 @@
TC-3 Given Code
---------------
Code is provided through the ':code:`tc-base`' repository, using tag ':code:`2021-tc-base-3.0`'. For a description of
Code is provided through the :code:`tc-base` repository, using tag :code:`2021-tc-base-3.0`. For a description of
the new module, see :ref:`src/bind`.
......@@ -3,5 +3,5 @@
TC-4 Given Code
---------------
Some code is provided through the ':code:`tc-base`' repository, using tag ':code:`2021-tc-base-4.0`'. For a
Some code is provided through the :code:`tc-base` repository, using tag :code:`2021-tc-base-4.0`. For a
description of the new module, see :ref:`src/type`.
......@@ -3,7 +3,7 @@
TC-5 Code to Write
------------------
You are encouraged to first try very simple examples: ‘:code:`nil`’, ‘:code:`1 + 2`’, ‘:code:`"foo" < "bar"`’ etc. Then consider supporting
You are encouraged to first try very simple examples: :code:`nil`, :code:`1 + 2`, :code:`"foo" < "bar"` etc. Then consider supporting
variables, and finally handle the case of the functions.
temp::Identifier
......
......@@ -3,5 +3,5 @@
TC-5 Given Code
----------------------
Some code is provided through the ‘:code:`tc-base`’ repository, using tag ‘:code:`2021-tc-base-5.0`’. For a description of the new modules, see :ref:`src/temp`, :ref:`src/tree`,
Some code is provided through the :code:`tc-base` repository, using tag :code:`2021-tc-base-5.0`. For a description of the new modules, see :ref:`src/temp`, :ref:`src/tree`,
:ref:`src/frame`, :ref:`src/translate`.
......@@ -39,8 +39,8 @@ Default copy constructor, default assignment operator
Template template parameters
C++ allows several kinds of entities to be used as template parameters. The most well known kind is “type”:
you frequently parameterize class templates with types via ‘:code:`template <typename T>`’ or
‘:code:`template <class T>`’. But you may also parameterize with a class template. The :code:`temp` module
you frequently parameterize class templates with types via :code:`template <typename T>` or
:code:`template <class T>`. But you may also parameterize with a class template. The :code:`temp` module
heavily uses this feature: understand it, and be ready to write similar code.
Explicit template instantiations
......
......@@ -8,7 +8,7 @@ Maximal node sharing
two equal instantiations of :code:`tree::Temp`. The same applies to more complex constructs such as the same translation if :code:`foo` is
actually a frame resident variable etc. Because memory consumption may have a negative impact on performances, it is desirable to
implement maximal sharing: whenever a Tree is needed, we first check whether it already exists and then reuse it. This must be done
recursively: the translation of ‘:code`(x + x) * (x + x)`’ should have a single instantiation of ‘:code:`x + x`’ instead of two, but also a
recursively: the translation of :code`(x + x) * (x + x)` should have a single instantiation of :code:`x + x` instead of two, but also a
single instantiation of ‘x’ instead of four.
Node sharing makes some algorithms, such as rewriting, more complex, especially wrt memory management. Garbage collection is almost
......
......@@ -3,7 +3,7 @@
TC-5 Optimizing Cascading If
----------------------------
Optimize the number of jumps needed to compute nested :code:`if`, using ‘:code:`translate::Ix`’. A plain use of ‘:code:`translate::Cx`’ is
Optimize the number of jumps needed to compute nested :code:`if`, using :code:`translate::Ix`. A plain use of :code:`translate::Cx` is
possible, but less efficient.
Consider the following sample:
......@@ -134,7 +134,7 @@ A naive implementation will probably produce too many :code:`cjump` instructions
**Example 4.79**: havm --profile boolean-1.hir
An analysis of this pessimization reveals that it is related to the computation of an intermediate expression (the value of
‘:code:`if 11 < 22 then 33 < 44 else 55 < 66`’) later decoded as a condition. A better implementation will produce:
:code:`if 11 < 22 then 33 < 44 else 55 < 66`) later decoded as a condition. A better implementation will produce:
.. code::
......
......@@ -99,7 +99,7 @@ Fortunately, you can ask :code:`havm` for a verbose execution:
**Example 4.74**: havm --trace arith.hir
If you look carefully, you will find an ‘:code:`sxp 7`’ in there...
If you look carefully, you will find an :code:`sxp 7` in there...
Then you are encouraged to implement control structures.*
......
......@@ -7,8 +7,8 @@ See :ref:`src/ast`, and :ref:`src/escapes`.
ast::PrettyPrinter
Implement :code:`--escapes-display` support in the :code:`PrettyPrinter`. Follow strictly the output format, since
we parse your output to check it. Display the ':code:`/* escaping */`' flag where needed, and only where needed:
each definition of an escaping variable/formal is *preceded* by the comment ':code:`/* escaping */`'. Do not display
we parse your output to check it. Display the :code:`/* escaping */` flag where needed, and only where needed:
each definition of an escaping variable/formal is *preceded* by the comment :code:`/* escaping */`. Do not display
meaningless flags due to implementation details. How this pretty-printing is implemented is left to you, but factor
common code.
......
......@@ -15,8 +15,8 @@ contents of a new stage is labeled with a :code:`class-tc-base-x.y` tag.
Here is the recommended strategy to use this repository.
1) At TC-1, subscribe to the repository, fetch its contents and integrate the given
code using :code:`git merge` with the commit labeled ':code:`2021-tc-base-1.0`'
into your ':code:`master`' branch:
code using :code:`git merge` with the commit labeled :code:`2021-tc-base-1.0`
into your :code:`master` branch:
.. code::
......@@ -32,7 +32,7 @@ Here is the recommended strategy to use this repository.
$ git commit
2) For any subsequent stage m, all you will need to do is fetch the new commits from the
':code:`tc-base`' repository and merge the code given at stage m into yours (and of
:code:`tc-base` repository and merge the code given at stage m into yours (and of
course, fix the conflicts). E.g.:
.. code::
......
......@@ -22,7 +22,7 @@ The :code:`build-aux` Directory
**File: rebox.el(build-aux/)**
This file provides two new Emacs fucntions, ':code:`M-x rebox-comment`' and ':code:`M-x rebox-region`'.
This file provides two new Emacs fucntions, :code:`M-x rebox-comment` and :code:`M-x rebox-region`.
They build and maintain nice looking boxed comments in most languages. Once installed (read it for
instructions), write a simple comment such as:
......@@ -30,7 +30,7 @@ The :code:`build-aux` Directory
// Comments end with a period.
then move your cursor into this comment and press ':code:`C-u 2 2 3 M-q`' to get:
then move your cursor into this comment and press :code:`C-u 2 2 3 M-q` to get:
.. code::
......
......@@ -3,7 +3,7 @@
The :code:`src/ast` Directory
-----------------------------
Namespace ':code`ast`', delivered for TC-2. Implementation of the abstract syntax tree. The file
Namespace :code:`ast`, delivered for TC-2. Implementation of the abstract syntax tree. The file
:code:`ast/README` gives an overview of the involved class hierarchy.
**File: location.hh (src/ast/)**
......
......@@ -3,7 +3,7 @@
The :code:`src/bind` Directory
------------------------------
Namespace ':code:`bind`'. Binding uses to definitions.
Namespace :code:`bind`. Binding uses to definitions.
**File: binder.* (src/bind/)**
......
......@@ -3,7 +3,7 @@
The :code:`src/escapes` Directory
---------------------------------
Namespace ':code:`escapes`'. Compute the escaping variables.
Namespace :code:`escapes`. Compute the escaping variables.
**File: escapes-visitor.* (src/escapes/)**
......
......@@ -3,4 +3,4 @@
The :code:`src/overload` Directory
----------------------------------
Namespace ':code:`overload`'. Overloading function support.
Namespace :code:`overload`. Overloading function support.
......@@ -3,7 +3,7 @@
The :code:`src/parse` Directory
-------------------------------
Namespace ':code:`parse`'. Delivered during TC-1.
Namespace :code:`parse`. Delivered during TC-1.
**File: scantiger.ll (src/parse/)**
......@@ -23,4 +23,4 @@ Namespace ':code:`parse`'. Delivered during TC-1.
**File: libparse.hh (src/ast/)**
Which prototypes what :code:`tc.cc` needs to know about the module ':code:`parse`'.
Which prototypes what :code:`tc.cc` needs to know about the module :code:`parse`.
......@@ -3,7 +3,7 @@
The :code:`src/translate` Directory
-----------------------------------
Namespace ':code:`translate`. Translation to intermediate code translation. It includes:
Namespace :code:`translate`. Translation to intermediate code translation. It includes:
**File: libtranslate.* (src/translate/)**
......
......@@ -3,7 +3,7 @@
The :code:`src/type` Directory
------------------------------
Namespace ':code:`type`'. Type checking.
Namespace :code:`type`. Type checking.
**File: libtype.\* (src/type/)**
......
......@@ -15,14 +15,14 @@ The Top Level
Noël Flantier <noel.flantier@epita.fr>
The group leader is first. Do not include emails other than those of EPITA. We repeat: give the
':code:`login@epita.fr`' address. Starting from TC-1, the file :code:`AUTHORS.txt` is distributed
:code:`login@epita.fr` address. Starting from TC-1, the file :code:`AUTHORS.txt` is distributed
thanks to the :code:`EXTRA_DIST` variable in the top-level :code:`Makefile.am`, but pay attention
to the spelling.
**ChangeLog**
Optional. The list of the changes made in the compiler, with the dates and names of the people who
worked on it. See the Emacs key binding ':code:`C-x 4 a`'.
worked on it. See the Emacs key binding :code:`C-x 4 a`.
**README.txt**
......
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