Commit 28da1ca8 authored by Serval MARTINOT-LAGARDE's avatar Serval MARTINOT-LAGARDE 🐯
Browse files

tcsh-and-swig: create tcsh directory in source code

* source/source_code/project_layout/index.rst,
* source/source_code/project_layout/tcsh.rst,
* source/source_code/project_layout/the_top_level.rst: Here.
parent 2954de8f
.. _Project Layout:
Project Layout
==============
This section desribes the mandatory layout of the package.
.. :The Top Level: Sub Tools, Tests
.. :build-aux: Build auxiliary tools
.. :lib/misc: Miscellaneous Tools
.. :src: The Driver
.. :src/task: Handling Options
.. :src/ast: Parsing
.. :src/bind: Abstract Syntax Tree
.. :src/escapes: Binding uses to definitions
.. :src/type: Type Checking
.. :src/object: Handling Object-Oriented Constructs
.. :src/overload: Function Overloading
.. :src/astclone: Duplicating an Abstract Syntax Tree
.. :src/desugar: Removing Syntactic Sugar
.. :src/inlining: Inlining of function bodies
.. :src/combine: Combine different extensions together
.. :src/llvmtranslate: Translation to LLVM IR
.. :src/temp: Fresh Registers and Labels
.. :src/tree: Intermediate Representations
.. :src/frame: Function Arguments and Variables
.. :src/translate: Translation to Tree
.. :src/canon: Simplification from HIR to LIR
.. :src/assem: Generic Assembly support
.. :src/target: Translation to Assem
.. :src/target/mips: Translation to MIPS assembly
.. :src/target/ia32: Translation to IA-32 assembly
.. :src/target/arm: Translation to ARM assembly
.. :src/liveness: Flowgraph and Liveness
.. :src/regalloc: Register Allocation
.. toctree::
the_top_level
build_aux
lib_misc
src
src_task
src_parse
src_ast
src_bind
src_escapes
src_type
src_object
src_overload
src_astclone
src_desugar
src_inlining
src_combine
src_llvmtranslate
src_temp
src_tree
src_frame
src_translate
src_canon
src_assem
src_target
src_target_mips
src_target_ia32
src_target_arm
src_liveness
src_regalloc
.. _Project Layout:
Project Layout
==============
This section desribes the mandatory layout of the package.
.. :The Top Level: Sub Tools, Tests
.. :build-aux: Build auxiliary tools
.. :lib/misc: Miscellaneous Tools
.. :src: The Driver
.. :src/task: Handling Options
.. :src/ast: Parsing
.. :src/bind: Abstract Syntax Tree
.. :src/escapes: Binding uses to definitions
.. :src/type: Type Checking
.. :src/object: Handling Object-Oriented Constructs
.. :src/overload: Function Overloading
.. :src/astclone: Duplicating an Abstract Syntax Tree
.. :src/desugar: Removing Syntactic Sugar
.. :src/inlining: Inlining of function bodies
.. :src/combine: Combine different extensions together
.. :src/llvmtranslate: Translation to LLVM IR
.. :src/temp: Fresh Registers and Labels
.. :src/tree: Intermediate Representations
.. :src/frame: Function Arguments and Variables
.. :src/translate: Translation to Tree
.. :src/canon: Simplification from HIR to LIR
.. :src/assem: Generic Assembly support
.. :src/target: Translation to Assem
.. :src/target/mips: Translation to MIPS assembly
.. :src/target/ia32: Translation to IA-32 assembly
.. :src/target/arm: Translation to ARM assembly
.. :src/liveness: Flowgraph and Liveness
.. :src/regalloc: Register Allocation
.. :tcsh: SWIG implementation in Tiger
.. toctree::
the_top_level
build_aux
lib_misc
src
src_task
src_parse
src_ast
src_bind
src_escapes
src_type
src_object
src_overload
src_astclone
src_desugar
src_inlining
src_combine
src_llvmtranslate
src_temp
src_tree
src_frame
src_translate
src_canon
src_assem
src_target
src_target_mips
src_target_ia32
src_target_arm
src_liveness
src_regalloc
tcsh
.. _tcsh:
The :code:`tcsh` Directory:
---------------------------
**Directory: src (tcsh/)**
Contains all TCSH sources. Sources are :code:`.i` SWIG files and two :code:`.hh` macro helpers.
**Files: tiger_*.i (tcsh/src/)**
There is one file per module of Tiger. It creates a python module named :code:`tiger_ast` by example.
**File: helper.hh (tcsh/src/)**
This file is a helper to define two macros to convert object to a real swig type.
**File: swig_real_type.hh (tcsh/src/)**
This file creates a visitor to get the real ast swig type of a swig object.
**Directory: python (tcsh/)**
Contains pythons script and tests.
**Directory: tests (tcsh/python/)**
Contains all jupyter notebook tests which check the implementation of TCSH.
**File: ipynbtest.py (tcsh/python/tests/)**
Script for running and testing notebooks comparing outputs. It is used to run every :code:`.ipynb` file when you run :code:`make check`.
**Files: *.ipynb (tcsh/python/tests/)**
There is one file per module implemented in SWIG. You can read it to understand how to use TCSH.
**File: tc.py (tcsh/python/)**
This file is the index of the package python named :code:`tc`.
It also defines one custom `magic cell <https://ipython.readthedocs.io/en/stable/interactive/magics.html#cell-magics>`_ command: :code:`%%tiger`.
**File: ti.py (tcsh/python/)**
The file :code:`ti.py`, for Tiger Interpreter, is a python helper to call tiger libraries. It can be run as a script when the environment is set (**tcsh/run**).
By example:
:code:`tcsh/run tcsh/python/ti.py -b llvm tests/good/fact.tig`
**Files: tcsh-llvm.test, tcsh-hir.test, tcsh-lir.test, tcsh-ia32.test and tcsh-mips.test (tcsh/python/)**
All these files run the :code:`ti.py` with a different back-end on :code:`fact.tig`
**File: run (tcsh/)**
Generated from :code:`run.in`, used to load environment variables :code:`PYTHONPATH` and :code:`DYLD_LIBRARY_PATH`. It can be used with argument :code:`export` to show variables to define in environment before running an :code:`import tc` in python.
.. _The Top Level:
The Top Level
-------------
**AUTHORS.txt**
In the top level of the distribution, there must be a file :code:`AUTHORS.txt` which contents is
as follows:
.. code-block:: none
Fabrice Bardèche <fabrice.bardeche@epita.fr>
Jean Dujardin <jean.dujardin@epita.fr>
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
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.
**README.txt**
Various free information.
**NEWS.txt**
Optional. Summary of changes introduced by each release.
**lib/**
This directory contains helping tools, that are not specific to the project.
**src/**
All the sources are in this directory.
**tests/**
Your own test suite. You should make it part of the project, and ship it like the rest of the package.
Actually, it is abnormal not to have a test suite here.
.. _The Top Level:
The Top Level
-------------
**AUTHORS.txt**
In the top level of the distribution, there must be a file :code:`AUTHORS.txt` which contents is
as follows:
.. code-block:: none
Fabrice Bardèche <fabrice.bardeche@epita.fr>
Jean Dujardin <jean.dujardin@epita.fr>
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
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.
**README.txt**
Various free information.
**NEWS.txt**
Optional. Summary of changes introduced by each release.
**lib/**
This directory contains helping tools, that are not specific to the project.
**src/**
All the sources are in this directory.
**tcsh/**
The implementation of SWIG in Tiger.
**tests/**
Your own test suite. You should make it part of the project, and ship it like the rest of the package.
Actually, it is abnormal not to have a test suite here.
Supports Markdown
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