Begin defining the meta language.
The Cretonne meta language is used to describe Cretonne instructions, both the target independent ones in the base instruction set and real target instructions. Start by providing type definitions matching langref, and begin the meta language reference using autodoc to pull in the PYthon definitions.
This commit is contained in:
@@ -21,6 +21,10 @@ import shlex
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# Also add the meta directory to sys.path so autodoc can find the Cretonne meta
|
||||
# language definitions.
|
||||
sys.path.insert(0, os.path.abspath('../meta'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
|
||||
@@ -7,6 +7,7 @@ Contents:
|
||||
:maxdepth: 2
|
||||
|
||||
langref
|
||||
metaref
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
33
cranelift/docs/metaref.rst
Normal file
33
cranelift/docs/metaref.rst
Normal file
@@ -0,0 +1,33 @@
|
||||
********************************
|
||||
Cretonne Meta Language Reference
|
||||
********************************
|
||||
|
||||
.. default-domain:: py
|
||||
.. highlight:: python
|
||||
|
||||
The Cretonne meta language is used to define instructions for Cretonne. It is a
|
||||
domain specific language embedded in Python.
|
||||
|
||||
An instruction set is described by a Python module under the :file:`meta`
|
||||
directory that has a global variable called ``instructions``. The basic
|
||||
Cretonne instruction set described in :doc:`langref` is defined by the Python
|
||||
module :mod:`cretonne.instrs`.
|
||||
|
||||
Types
|
||||
=====
|
||||
|
||||
Concrete value types are represented as instances of :class:`cretonne.Type`. There are
|
||||
subclasses to represent scalar and vector types.
|
||||
|
||||
.. autoclass:: cretonne.Type
|
||||
.. autoclass:: cretonne.ScalarType
|
||||
:members:
|
||||
.. autoclass:: cretonne.VectorType
|
||||
:members:
|
||||
.. autoclass:: cretonne.IntType
|
||||
:members:
|
||||
.. autoclass:: cretonne.FloatType
|
||||
:members:
|
||||
.. automodule:: cretonne.types
|
||||
:members:
|
||||
|
||||
Reference in New Issue
Block a user